Select to view content in your preferred language

Code Sample containing "@id" is being reformatted upon saving

813
2
01-17-2022 09:22 AM
jcarlson
MVP Esteemed Contributor

Hello! Came across what I believe to be a minor bug in the code blocks on Community posts.

var id = "@id"

In composing this post, here's what I see:

jcarlson_0-1642440139084.png

I'm going to save this post, and if it behaves like I saw in another post recently, it's going to be different. Will edit this post shortly with the results.

- Josh Carlson
Kendall County GIS
0 Kudos
2 Replies
jcarlson
MVP Esteemed Contributor

Well, it didn't do it. I'll post the full code from the related post:

var fs = FeatureSetByName($datastore, "Hydrant Inspections")
var id = $feature.hydrantID // just replace with your own field name as needed

// Get inspections for clicked hydrant
var filt_fs = Filter(fs, "hydrantID = @ID")

// Order inspections with most recent first
var ordered_fs = OrderBy(filt_fs, "InspectionDate DESC")

// Return most recent inspection specific to hydrant
var inspection = First(fs)

return inspection.InspectionDate

Perhaps it behaves differently in a reply than the main post, or perhaps that other post was just a fluke. Again, what I'm seeing while composing:

jcarlson_0-1642440301800.png

 

- Josh Carlson
Kendall County GIS
0 Kudos
jcarlson
MVP Esteemed Contributor

There it goes!

jcarlson_1-1642440330721.png

Stranger still, if I go to edit that post and change the expression the '@ID' portion of the code block is dropped entirely.

- Josh Carlson
Kendall County GIS
0 Kudos