Get Item at index from comma separated list

88
3
10-26-2020 05:54 AM
ArabiaGIS
New Contributor

Greetings,

am building a survey using the advanced template with the XLSForm.

I need to use a function that select one item from a comma separated list, the function should take in the input the list and the index as parameters to return the needed item ex:

list  A=(Sami, Sara, Fadi, Bruce)

Sami=getItemAtIndex(A,0);

Fadi=getItemAtIndex(A,2);

I tried to use a JavaScript function with the pulldata() and it works in the form preview but unfortunately it is not supported by the mobile app and give me scripts disabled. kindly advise how can i fix this issue or use the built in function for selection supported by other odk.

you quick response is very appreciated and thank you in advance

Best,

Ali Jaafar

Tags (1)
0 Kudos
3 Replies
IsmaelChivite
Esri Frequent Contributor

Hi Ali. The pulldata("@javascript") function requires the end user to he logged-in to the application. If you test your survey while logged-in, it should work. Also make sure your app is on the latest version.

0 Kudos
ArabiaGIS
New Contributor

Dear Ismael,

Thank you for your reply, kindly note that my survey will be public and i tried to access it from the mobile without signing in. screenshot is attached.

0 Kudos
ArabiaGIS
New Contributor

Dear Ismael,

I tried to login and it worked normally.

Do you think this function will be available for public soon?

even I tried to use the built-function "indexed-repeat" and it is not supported by survey 123 too, while it is a trivial in the other odk tools.

we are trying to proof the best of use of esri apps and products, while we are supporting a local government and humanitarian agency to conduct a child protection survey early next week.

if I didn't find a solution today I will be obligated to shift for an opensource survey tool.

Best,

AJ

0 Kudos