cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
adove
Helper II
Helper II

Condition statement WITHIN the email body

I have an email that requires an expression or a condition statement to be validated WITHIN the body of the email based on the value of a SharePoint list column. If the field length > 0 then include additional text. I have started playing with creating variables, but unsure of how to implement within the body section of the 'Send to email' action.

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @adove ,

 

Do you want to show the “dummy” markup dynamically based on the length of the column?

 

Please try if the following code will work for you. This steatement will retrun Dear <'name'> if the length is greater  than 10, otherwise, it will be blank.

if(greater(length(triggerBody()?['CC']),10),concat('dear','  ',triggerBody()?['CC']),'')

 

More details about the WDL functions, please check it at here:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
AlanPs1
Resident Rockstar
Resident Rockstar

Hi @adove , thank you for your post in the community!

 

I may be getting the gist of this and could potentially provide a solution but could you please post more detail and some pictures of your Flow so I can best advise?

 

If you have found my post helpful, please mark thumbs up.

 

Any other questions, just ask.

 

Thanks, Alan


Did I answer your question? Mark my post as a solution!

Proud to be a Flownaut!


v-yamao-msft
Community Support
Community Support

Hi @adove ,

 

Do you want to return texts based on the length of a SharePoint list column?

 

Please try inserting the following condition in the email body to see if it will meet your scenario.

 

 

if(greater(length(triggerBody()?['CC']),10),'there are more than 10 characters in this field',triggerBody()?['CC'])

 

The flow is configured likes below:

1.PNG

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Inside the body of a 'Send an email' action I have the following "dummy" markup.

 

If the SharePoint column <'First Name'> contains text 

then write the following:

Dear <'First Name'>,

We are pleased to announce...

 

 

Hi @adove ,

 

Do you want to show the “dummy” markup dynamically based on the length of the column?

 

Please try if the following code will work for you. This steatement will retrun Dear <'name'> if the length is greater  than 10, otherwise, it will be blank.

if(greater(length(triggerBody()?['CC']),10),concat('dear','  ',triggerBody()?['CC']),'')

 

More details about the WDL functions, please check it at here:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

 

Best regards,

Mabel

 

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (2,025)