Here is an outline of what I am trying to do in Survery123, but I reached a bit of a blocker at step 2.
Users:
Step 1 (done). Select their project name ('projectname') from a autocomplete select_one search function which gets data from an online feature layer. Done, see:
autocomplete search('findprojectname?url=https://services3.arcgis.com/Bb8lfThdhugyc4G3/arcgis/rest/services/service_4dc0ba5a63a041f1a474aa960...', 'projectname')
Step 2 (stuck) Search or pulldata from the same online feature layer to get the corresponding project code (called 'unique_ID') for the matching project name ('projectname') which they entered in step 1. Not sure if this is done through search under appearances or a calculation I've tried both and ot hasn't worked.
Step 3 (done) Concatenate the project code ('unique_ID') with today's date that is generated by using the now function to get an individual asset ID code which is read only. Done - see: concat(${'unique_ID'},"_",format-date(now(), '%y%m%d%H%M'))
I want them to have the option of using the project name which is more memorable to aquire the project code which will be less memorable. To make the survey more user friendly.
Thank you, hope someone can help.
Best wishes,
Heather.
Solved! Go to Solution.
I have managed to create a solution using the following in the appearances tab. However, it's a not a perfect solution as the user still needs to select the unique ID, even though only one option is available. Then the survey concatenates the values into one attribute code which contains the parent project code. I think a better solution will be possible using a pulldata function through javascript however, this isn't possible when sharing the survey to public at the moment. See post here for the solution that works for forms only shared within organisation. I've attached the search apperance solution example below as a spreadsheet.
autocomplete search('findcode?url=replacewithserviceurlxxx/FeatureServer/0', 'matches', 'projectname', ${projectname}, 'uniqueID')
This is 100% a shot in the dark since I haven't used a hosted feature layer with search() yet, but is it possible that your query isn't working because you need to URLencode the ${projectname} first?
I have managed to create a solution using the following in the appearances tab. However, it's a not a perfect solution as the user still needs to select the unique ID, even though only one option is available. Then the survey concatenates the values into one attribute code which contains the parent project code. I think a better solution will be possible using a pulldata function through javascript however, this isn't possible when sharing the survey to public at the moment. See post here for the solution that works for forms only shared within organisation. I've attached the search apperance solution example below as a spreadsheet.
autocomplete search('findcode?url=replacewithserviceurlxxx/FeatureServer/0', 'matches', 'projectname', ${projectname}, 'uniqueID')
@HeatherBell this was helpful, thanks. I have the exact same issue:
@IsmaelChivite , @JamesTedrick , @ZacharySutherby , @BrettStokes , @Shwu-jingJeng is there any way around this?
I am using the autocomplete search appearance to reference a dynamic hosted feature layer view where the user selects the last report number used in order to generate the next sequential number. I am trying to show the values in descending order but haven't found a solution. Latest expression = autocomplete search('FireId?url=https://services6.arcgis.com/iQxzOWEp1MXm2FTa/arcgis/rest/services/EFire2_Training_Fall23/FeatureSer...', 'matches', 'DOF_District', ${DOF_District}, 'orderByFields=RegionFireID, DESC') and I've tried a dozen other configurations with no luck and still get the list in ascending order (see screenshot). It does provide a filtered list based on the region but my user have to scroll to select the last number used. This is a text field so that might be the issue? Anyone have a possible solution for descending order list?