I have a hosted feature layer of signal light locations with a related table of inspections and maintenance. What I need to be able to do is allow the user to reopen a submitted form from Field Maps. The survey was created in Survey 123 Connect from the hosted feature layer, and currently users can click on a signal and hit a URL linked text that opens the survey with the signal's data prepopulated.
The challenge is, I need to be able to reopen either the most recent form or be able to sort forms that have the response of either "Need minor repair" or "Needs major repair." for each signal, reopen them in Survey 123 and edit, and then resubmit them. Below is my code so far, thanks to another Community Member, but I still can't get it to work.
When I click on the Linked Text for the Pop-up for the singal layer, it tries to open the Survey Inbox, but I get the error Code 400, Cannot perform query. Invalid query parameters. In the Survey 123 spreadsheet. I have the following in the bind::esri:parameters query="1=1&orderByFields=InspectionStartTime DESC" allowUpdates=true
@RachaelMurtaugh Instead of ordering the repeats have you tried to filter them to just "Need minor repair" or "Needs major repair."
query="Status IN ('Need minor repair','Needs major repair')"
or
query="Status = 'Need minor repair' OR Status = 'Needs major repair'"
Hi @RachaelMurtaugh, I currently have a similar pop-up in Field Maps that checks the inbox for a survey and if one doesn't exist it opens up a new survey with a few pre-populated fields and returns back to Field Maps upon submission of the survey. If you only expect one survey for each point I think my code my be helpful. However, if you conduct mutliple surveys for each point then the best way to filter for the Need minor repair" or "Needs major repair." would be using the Survey123 inbox query as @Neal_t_k suggested. I have my inbox filtering for the current year since I only want people editing this years data.
Two issues I was able to overcome with the Field Maps to Survey123 callback:
I added the code below to an Arcade Expression in my Web Map in the pop up. Please note anything in bold text should be replaced with your values. I hope this helps, callbacks can be frustrating but super helpful when they work.
Below is the code for my circumstance:
I will hang onto this for sure. I'm currently exploring Field Tasks and Forms to see if this will give me a more streamlined option for this.