Hello everyone,
I need to create a note that retrieves the record ID for the last submitted record that matches a zone ID. I've attempted to use the pulldata("@layer") function for this purpose, but the sorting statement ORDER BY CreationDate DESC doesn't seem to work as I expected. I've also tried using the objectId and timeStamp fields, but they didn't work either. Here is the expression that is currently working but only pulls the first matching record: pulldata("@layer", "getValue", "attributes.nest_ID", "https://services.arcgis.com/......./FeatureServer/0", concat("nestZoneKey='", ${nestZoneKey}, "'"), "ORDER BY CreationDate DESC", "1")
Thanks for any help or suggestions!
Solved! Go to Solution.
I think your syntax is wrong? If you look at the blog, orderByFields should be added to the URL.
I copied the blow text from the blog:
On top of the well defined parameters you can pass to the getRecord and getRecordAt operations, you can also pass extra parameters to the feature layer url to perform some more advanced queries. For example:
pulldata("@layer", "getRecordAt", "https://services.arcgis.com/QVENGdaPbd4LUkLV/ArcGIS/rest/services/USFWS_Critical_Habitat/FeatureServ...?distance=1600&units=esriSRUnit_Foot", ${location})
I highlighted in blue the key part where the distance and units are specified. These extra parameters are added to the URL. You need to add a question mark (?) to start adding extra parameters and then separate them with an ampersand symbol (&).
Check the Query (Feature layer) help topic to learn more about all the extra parameters you can use. The Request Parameters section in this help topic describes the parameters that you cannot use.
Thanks abureaux !
Indeed, you were correct. After a few attempts, I managed to get it working. Here's the final expression in case someone else encounters a similar requirement. Thank you once again for your assistance!
pulldata("@layer","getValue","attributes.nest_ID","https://services.arcgis.com/....._results/FeatureServer/0?orderByFields=survey_Date_time DESC",concat("nest_ZoneKey='", ${nest_ZoneKey}, "'"),"?t=", now())
JB
I think your syntax is wrong? If you look at the blog, orderByFields should be added to the URL.
I copied the blow text from the blog:
On top of the well defined parameters you can pass to the getRecord and getRecordAt operations, you can also pass extra parameters to the feature layer url to perform some more advanced queries. For example:
pulldata("@layer", "getRecordAt", "https://services.arcgis.com/QVENGdaPbd4LUkLV/ArcGIS/rest/services/USFWS_Critical_Habitat/FeatureServ...?distance=1600&units=esriSRUnit_Foot", ${location})
I highlighted in blue the key part where the distance and units are specified. These extra parameters are added to the URL. You need to add a question mark (?) to start adding extra parameters and then separate them with an ampersand symbol (&).
Check the Query (Feature layer) help topic to learn more about all the extra parameters you can use. The Request Parameters section in this help topic describes the parameters that you cannot use.
Thanks abureaux !
Indeed, you were correct. After a few attempts, I managed to get it working. Here's the final expression in case someone else encounters a similar requirement. Thank you once again for your assistance!
pulldata("@layer","getValue","attributes.nest_ID","https://services.arcgis.com/....._results/FeatureServer/0?orderByFields=survey_Date_time DESC",concat("nest_ZoneKey='", ${nest_ZoneKey}, "'"),"?t=", now())
JB