Select to view content in your preferred language

Learning to use Pulldata and can't determine my coding error (likely something simple)

98
3
Jump to solution
Thursday
DougMarshall2025
New Contributor

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.

integerStation_IdStation ID 
noteWhere2Where clause 2 
textStation_NameStation name isAlt Fuel stations
    
textNAMEEnter county name 
noteWhere1Where clause 
textFIPSThe county's FIPSUS 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})

 

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
Neal_t_k
Frequent Contributor

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})

View solution in original post

0 Kudos
3 Replies
Neal_t_k
Frequent Contributor

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})

0 Kudos
DougMarshall2025
New Contributor

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

0 Kudos
Neal_t_k
Frequent Contributor

@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/

0 Kudos