Select to view content in your preferred language

Invalid Calculate for Bind

440
3
12-21-2023 10:38 AM
CaitlinCaldwell
New Contributor

Hello, I am working in Survey123 Connect to pull data from an existing feature service when the user types in the facility name. I am using the following expression:

pulldata("@layer", "getValue", "attributes.SCRAP_TIRES_EA", 'https://maps.ihs.gov/server/rest/services/Oklahoma_SFC/OKC_Open_Dumps/FeatureServer/1,concat("FACILITY_NAME = '", ${FACILITY_NAME}, "'")

and getting the following error:

b'ODK Validate Error:\n>> XForm is invalid. See above errors. \norg.javarosa.xform.parse.XFormParseException: Invalid calculate for the bind attached to "${APPLIANCES_WHITEGOODS_EA}": couldn\t understand the expression starting at this point: ...CILITY_NAME , "\xcd\x8e\'")

I am pulling from a non-public data source Capture.JPG

0 Kudos
3 Replies
DougBrowning
MVP Esteemed Contributor

pulldata will always return a string.  You can try wrapping it in int like int(pulldata()) . 

But pulldata often has issues with being inside a function.  So if that does not work make a temp calculate field with hidden appearance with the pulldata calc.  Then in your integer field do int(tempfield).  You can set bind esri column to null on the temp field if you do not want it in the final schema.

Hope that all makes sense

0 Kudos
CaitlinCaldwell
New Contributor

Thank you for the reply! I was following the video linked below and tried switching the "type" to "decimal" rather than "integer" as was demonstrated in the video and still got the same error.

https://www.youtube.com/watch?v=sSjr8KV1HLc 

0 Kudos
DougBrowning
MVP Esteemed Contributor

No you have to wrap pulldata in int() or the 2 field trick.  Or leave as string if that is ok.

0 Kudos