I am creating a webhook using Microsoft Flow (Power Automate) from Survey 123 responses. I am trying to get all of the fields to appear in the body of the email, but only the text fields show up in the dynamic content. So I have to manually add the integer and date fields. I found a page from Ismael Chivite (https://community.esri.com/t5/arcgis-survey123-blog/automating-workflows-with-survey123-and-microsof...) that says you can add hidden content using the following syntax:
?['feature']?['attributes']?['yourhiddenquestioname']
I substituted one of the integer field names into the 'yourhiddenquestionname' part, ran a test and it did not work. I assume I have to substitute something into the 'feature' and 'attributes', but I am not sure what. Can anyone help with this and provide and example that I can follow?
Thanks!
Solved! Go to Solution.
James, I accidentally figured it out by copying everything in the body and pasting it into notepad. By doing this, it shows the exact syntax that the dynamic variables used. For your reference, and everyone elses, it is:
@{triggerOutputs()?['body/feature/attributes/FIELDNAME']}
Replace FIELDNAME with the field name you want added. I made the changes in Notepad and then copied and pasted into the body in Power Automate/Flow.
Thanks for your help! You steered me in the right direction 🙂
Linda
Hi,
This is a question concerning MS Power Automate syntax, so we can provide limited help. Doing a little bit of testing, it appears that the Power Automate preferred syntax for accessing webhook outputs may have been updated. The easiest way to see this is to create a formula that uses one of the inputs (as @IsmaelChivite did in the blog post). In his blog post, he had:
addseconds('1970-1-1', Div(triggerBody()?['feature']?['attributes']?['mydate'],1000) , 'yyyy-MM-dd')
When I attempt the same calculation in Power Automate, I am now seeing:
Thanks, James, but I am still not understanding what I need to do to manually add a field. Which expression do I use? I'm sorry for not understanding. This is my first attempt at using webhooks.
Thanks again.
I would try the triggerOuputs method and try by bringing another field into an expression/calculatoin to get the syntax correct. An easy one to use for text would be concat() (which joins text); if need be you could use an empty string ('') as what it would join with.
James, I accidentally figured it out by copying everything in the body and pasting it into notepad. By doing this, it shows the exact syntax that the dynamic variables used. For your reference, and everyone elses, it is:
@{triggerOutputs()?['body/feature/attributes/FIELDNAME']}
Replace FIELDNAME with the field name you want added. I made the changes in Notepad and then copied and pasted into the body in Power Automate/Flow.
Thanks for your help! You steered me in the right direction 🙂
Linda
Thanks Linda for posting your solution! Exactly what I was looking for. Works great!