Integromat Response Email with If Function

356
0
04-06-2022 07:25 AM
ZachBodenner
MVP Regular Contributor

Hello,

I have a Survey123 survey that is being watched by a webhook through Integromat/Make. The survey is published based on a feature class on our federated portal server. I am trying to get the Email response in the webhook to evaluate against an attribute and send an appropriate response. Here's the setup:

Respondents to the Survey123 form identify whether or not they are a home owner (Owner) or a renter (Renter) in the attribute "Status." After answering a variety of quetions about their sustainable/green behaviors, the survey uses background fields to calculate a score, which is then used to populate a field called "Tier" if the respondent is an owner, or "TierRenter" if they are a renter (each of these fields is a text field and will have the values "Gold" "Silver" "Bronze"). Respondents submit their email as part of the survey and will receive a response email from Integromat after their submission. I have gotten this aspect of the project working. 

In the content portion of the email response, I would like to have the tier of the respondent identified. The trouble is, I can't just plop the attribute in the contents. I want to evaluate against the attribute "Status" so that if the respondent is an owner, their content includes the value within the "Tier" attribute, and if they are a renter then the "TierRenter."

Here is what is currently in the contents HTML (See photo for how it looks in Integromat):

Thank you for submitting your  Survey! Based on your responses, you rank in the{{if(1.feature.attributes.Status + "= ""Owner"""; 1.feature.attributes.Tier; 1.feature.attributes.TierRent)}} tier.

 

However, all I get is the text portion, "Thank you for submitting your  Survey! Based on your responses, you rank in the tier." as the email response. I've tried using single and no quotes around the value in status, but no dice. Any ideas?

0 Kudos
0 Replies