Power Automate email formatting with empty questions/answers

167
2
Jump to solution
06-22-2021 03:00 PM
AndrewPriest
New Contributor II

hi. an email is triggered by a Survey123 submission. the survey has many questions that will not have answers, but I'm using dynamic expressions in the email to list all of the questions/answers in the survey. rather than listing a blank space for the unanswered questions is there a workflow to populate "NA" or "Empty"? can the payload be configured to update the dynamic content in Power Automate accordingly? Example:

Project Number: PRJ-000119
Activity in a Building: No
Building Floor(s): is "NA" or something rather than blank a dynamic option for these non-answers?

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
IsmaelChivite
Esri Frequent Contributor

I think the coalesce() function in Power Automate will do the trick for you.  This function can take a value from dynamic content and a fixed string (such as "NA"). If your value from dynamic content is empty, it will return your fixed string.

For example if my Survey123 question called dept is empty, I will get back NA: coalesce(triggerOutputs()?['body/feature/attributes/dept'],'NA')

Coalesce.gif

 

View solution in original post

2 Replies
IsmaelChivite
Esri Frequent Contributor

I think the coalesce() function in Power Automate will do the trick for you.  This function can take a value from dynamic content and a fixed string (such as "NA"). If your value from dynamic content is empty, it will return your fixed string.

For example if my Survey123 question called dept is empty, I will get back NA: coalesce(triggerOutputs()?['body/feature/attributes/dept'],'NA')

Coalesce.gif

 

View solution in original post

AndrewPriest
New Contributor II

perfect! thank you, Ismael

0 Kudos