Hello all
I'm learning how to use Survey 123 via simple initial codes and have hit a roadblock with the pulldata function. I successfully got it to work with the ESRI county data example found under the S123 tutorials, but I can't replicate it with a new layer attempt. I used basically the same coding, but the second attempt with fuel station data refuses to work. If I remove the Where clause, I can get the default 1=1 result (first entry in layer), but the function doesn't work with or without the where clause. I've used ArcGIS Pro for many years, so I am fairly certain it is a blatantly obvious simple error as it usually is when I'm stumped for days. I would greatly appreciate it if someone could point out my error or at least throw some suggestions my way. Thank you in advance.
| integer | Station_Id | Station ID | |
| note | Where2 | Where clause 2 | |
| text | Station_Name | Station name is | Alt Fuel stations |
| text | NAME | Enter county name | |
| note | Where1 | Where clause | |
| text | FIPS | The county's FIPS | US Counties |
| concat("Name is=", ${Station_Id}) |
| pulldata("@layer","getValue","attributes.Station_Name","https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/Alternate_Fuel/FeatureServer/0",${Station_Id}) |
| concat("NAME='", ${NAME}, "'") |
| pulldata("@layer","getValue", "attributes.FIPS","https://services5.arcgis.com/jMCHJcLe13FaKCFB/arcgis/rest/services/US_Counties/FeatureServer/0", ${Where1}) |
Solved! Go to Solution.
Your second one is working for me.
The first one there are couple things needing adjustment
Where2 calc: concat("Station_Id=", ${Station_Id})
Station_Name calc: pulldata("@layer","getValue","attributes.Station_Name","https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/Alternate_Fuel/FeatureServer/0",${Where2})
Your second one is working for me.
The first one there are couple things needing adjustment
Where2 calc: concat("Station_Id=", ${Station_Id})
Station_Name calc: pulldata("@layer","getValue","attributes.Station_Name","https://services9.arcgis.com/RHVPKKiFTONKtxq3/arcgis/rest/services/Alternate_Fuel/FeatureServer/0",${Where2})
Neal,
Thank you very much for the prompt reply and solution. The terms used in the Where clause was the key. I did not realize that the initial part in the statement (Station name is) was not just a text message for convenience. Believe it or not, the ESRI help pages were not particularly clear on this (LOL). I appreciate you helping me over the speedbump. Take care.
Doug Marshall
@DougMarshall2025 essentially you are using the Rest Api to make a query to the feature layer. That part of the pulldata code is a where statement in sql.
https://developers.arcgis.com/rest/services-reference/enterprise/query-feature-service-layer/