Survey123 Power Automate Trigger Issues

3374
15
Jump to solution
11-23-2021 10:52 AM
RobertAnderson3
MVP Regular Contributor

I've been using Automate for a handful of surveys my organization uses, last week I went to create a webhook for a new survey that follows the same basic structure as previous ones. 

First issue I had was it wouldn't display any dynamic content, I fixed this by adding labels to every group/repeat, a bit annoying and cluttered but hey, it worked. I also want to point out I have webhooks/surveys that currently work and would allow me to work without this being the case.

This second issue I'm struggling with more. I get this error:

ResponseSwaggerSchemaValidationFailure. The API 'survey123' returned an invalid response for workflow operation 'When_a_survey_response_is_submitted' of type 'OpenApiConnectionWebhook'. Error details: 'The API operation 'AddData' requires the property 'body/feature/repeats/employee_repeat/0/attributes/addEmployees' to be of type 'String' but is of type 'Integer'.'

It's referring to a question on the survey that is a select_one using employee IDs as the data it passes. These have always passed as a string because it's a select_one question. However NOW it seems to be passing it as an integer, but because the field is a string it sees a mismatch and it breaks it. If I remove that field from the actions in the webhook it let's it run, but it's a fairly important attribute to include.

Anyone have any ideas what's causing this? Is there an issue with updates to Survey123 recently?

15 Replies
KaliLegg
New Contributor

@BarbaraWebster1 Im still seeing this error. Is there any more documentation on the workaround you mentioned above? Thanks

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@KaliLegg There is no specific documentation for this workaround, but I attached an example XLSForm. 

0 Kudos
Coles_Brendan
New Contributor II

I'm also experiencing the same issue. I have a collector app with points that links to a Survey123 form for inspections. Once the survey is complete, its supposed to trigger a PowerAutomate workflow to push a few key fields from the related inspection back to the point, including the inspection date, which is used to change point colours so field workers can quickly see a visual of what's been recently inspected vs needs to be re-visited. The inspection date is key for the field workers workflow and this error on our date field has completely broken our app. @BarbaraWebster1 how quickly will this be resolved. Note our inspectors are using the Survey123 mobile app, not the web version.

StanislausCounty
New Contributor III

Given the speed of the last bug fix I wouldn't count on having this fixed any time soon. You probably are going to need to kluge a workaround similar to the select one where you create a text question, use the calculate to populate it in such a way that you can then parse it in power automate to send back the data you want.

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@KelseyFournier @Coles_Brendan After a closer look, the fix for July 2022 was specific to Power Automate field types respecting any field types that were set in the bind::esri:fieldType  column. The select_one issue is logged as BUG-000151353.

I was able to reproduce the date and dateTime issue and logged a separate internal bug issue for it.

Currently there are no additional workarounds besides the original one provided.

0 Kudos
BarbaraWebster1
Esri Regular Contributor

@KelseyFournier @Coles_Brendan A fix for the date and dateTime error was applied to the Survey123 website yesterday. Can you try your flows out and see if you are still running into the same error?

0 Kudos