Select to view content in your preferred language

Survey123 pulldata from attribute table not working

1264
6
Jump to solution
11-30-2023 12:39 PM
RoscoPeters17
Emerging Contributor

I have a field titled "user_id", which is manually entered by the user. If there is a match I would like to use this entry to pull attribute data from a hosted table (see rest endpoint below) to auto populate the second field with the data in the "name_first" field on my survey. My current code does not return anything. Please advise:

pulldata("@layer","getValue","attributes.name_first","https://services3.arcgis.com/kTHh5mF5pghzqQ3m/arcgis/rest/services/verified_users/FeatureServer/0",concat("user_id =",${user_id},"'"))

*this data is not sensitive

 

 

Tags (3)
0 Kudos
1 Solution

Accepted Solutions
rwrenner_esri
Esri Alum

Hi Rosco,

The first concat value is missing a single quotation mark (bolded):

pulldata("@layer","getValue","attributes.name_first","https://services3.arcgis.com/kTHh5mF5pghzqQ3m/arcgis/rest/services/verified_users/FeatureServer/0",concat("user_id ='",${user_id},"'"))

-Rylee

View solution in original post

0 Kudos
6 Replies
rwrenner_esri
Esri Alum

Hi Rosco,

The first concat value is missing a single quotation mark (bolded):

pulldata("@layer","getValue","attributes.name_first","https://services3.arcgis.com/kTHh5mF5pghzqQ3m/arcgis/rest/services/verified_users/FeatureServer/0",concat("user_id ='",${user_id},"'"))

-Rylee

0 Kudos
RoscoPeters17
Emerging Contributor

Thank you Rylee. I'm getting syntax error with the added added single quotation mark. I'm very much in the learning phase with connect, so this is much appreciated.

RoscoPeters17_0-1701461044973.png

0 Kudos
rwrenner_esri
Esri Alum

In the error message, I see "/Form_1/" in the latter part of the concat statement. Does that match what's in the XLSForm calculation column? I didn't see that text included your initial pulldata so wondering if it got added and if that's causing the syntax error.

0 Kudos
RoscoPeters17
Emerging Contributor

The calculations column does not have the "Form_1" but it shows up in the error. The survey is titled Form 1

 

RoscoPeters17_0-1701462007364.png

 

0 Kudos
rwrenner_esri
Esri Alum

Thanks for clarifying. I'd suggest updating to the latest version of S123 Connect (3.19) if you don't already have it.

To check what version of S123 Connect are you on, click on your profile at top right:

rwrenner_0-1701462154713.png

 

0 Kudos
RoscoPeters17
Emerging Contributor

I was running 3.12. Just updated to 3.19 and ran the survey with the additional recommended single quotation mark and voila!!! Can't thank you enough, I would have never thought to check software version.

RoscoPeters17_0-1701463063999.png