Hello,
I am currently struggling with setting up a flow that would have conditional text inserted on its body.
The condition is based on an Excel table, in order to exemplify, lets say that I have the ID column, and then I have 4 different columns named (Document 1, Document 2, Document 3, Document 4), each of these columns are going to be populated with an "X" or a "Yes".
The goal would be to write an email as follows:
"Hello (Name)
We are contacting you regarding your documentation, as follows:
This way the body of my email would address each missing item for each person.
I am having difficulties with creating an "IF" function that would look into my column and according to the result of the function either insert a text in the Email's body or do nothing.
Solved! Go to Solution.
Hi @mottandre,
You could use the if and equals functions for that and look for the X value.
Below is an example of that.
This example works with a List rows present in table and apply to each action. You might need to amend the column names in the expressions. And also the li html tags are rendered when there is nothing.
<p>Hello (Name)<br>
We are contacting you regarding your documentation, as follows:<br>
</p>
<ul>
<li>@{if(equals(items('Apply_to_each')?['Document1'], 'X'), 'Some Random Text 1', '')}</li>
<li>@{if(equals(items('Apply_to_each')?['Document2'], 'X'), 'Some Random Text 2', '')}</li>
<li>@{if(equals(items('Apply_to_each')?['Document3'], 'X'), 'Some Random Text 3', '')}</li>
<li>@{if(equals(items('Apply_to_each')?['Document4'], 'X'), 'Some Random Text 4', '')}</li>
</ul>
Hope this helps to get you started?
Hi @mottandre,
You could use the if and equals functions for that and look for the X value.
Below is an example of that.
This example works with a List rows present in table and apply to each action. You might need to amend the column names in the expressions. And also the li html tags are rendered when there is nothing.
<p>Hello (Name)<br>
We are contacting you regarding your documentation, as follows:<br>
</p>
<ul>
<li>@{if(equals(items('Apply_to_each')?['Document1'], 'X'), 'Some Random Text 1', '')}</li>
<li>@{if(equals(items('Apply_to_each')?['Document2'], 'X'), 'Some Random Text 2', '')}</li>
<li>@{if(equals(items('Apply_to_each')?['Document3'], 'X'), 'Some Random Text 3', '')}</li>
<li>@{if(equals(items('Apply_to_each')?['Document4'], 'X'), 'Some Random Text 4', '')}</li>
</ul>
Hope this helps to get you started?
Hello Dennis!
I really appreciate the attention and the time taken! I will be going through my data and making some tests and I will come back to either change this question to Solved or to ask another further detail, best regards!
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
User | Count |
---|---|
44 | |
18 | |
15 | |
14 | |
11 |
User | Count |
---|---|
81 | |
34 | |
29 | |
21 | |
20 |