web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Help writing expressio...
Power Automate
Unanswered

Help writing expressions for optional fields using Send an email v2

(0) ShareShare
ReportReport
Posted on by 15

Can anyone help me learn how to write an expression for Power automate cloud flow using Send an email v2 form.


Scenario 1:
In my MS form there is an optional field for a supervisors email address. I would like that email address to be added to cc field IF there is a value. At the moment it's creating issue because if the fields is blank / null value I am getting multiple unwanted emails from Microsoft Forms when testing the flow.


Scenario 2:  I would I like to add the response to another question into the subject line IF it selected, the value would be the prefix of !URGENT  in the email subject. However, if the option is not selected then it should be no prefix in the email subject. 


I believe these are 2 similar scenarios but I have no idea where to begin. Any help would be much appreciated. (I am very new so please spell out in laymans terms).

Thank you, much appreciated.

Categories:
I have the same question (0)
  • faustocapellanj Profile Picture
    1,662 on at

    Hello @tarastanhope 

    Please see the expressions for each of your scenarios below.

    Scenario 1:

    The expression needs to check if the field is not empty as follows: 

    if(not(empty(outputs('Get_response_details')?['body/r2607482f03d444ea982da7b4919484ed'])), outputs('Get_response_details')?['body/r2607482f03d444ea982da7b4919484ed'], '')

     If it is not empty, the email value is used, else, it will be left blank using the two single quotes at the end of the expression (''). The outputs('Get_response_details')?['body/r2607482f03d444ea982da7b4919484ed'] is the form field used to capture the email address. The long value that starts with r will be different for you, but it will look like that.

    Scenario 2:

    The expression checks if the selected value is equals to the desired value as follows:

    if(equals(outputs('Get_response_details')?['body/rc56f4b6dfdeb4d8b96efebe5a4bfef6f'], 'Really Bad'), '!URGENT', '')

    If the desired value is found, the expression will add !URGENT to the beginning of the email subject, it will be left blank using the two single quotes at the end of the expression ('').

     

    Please try this and let me know.

     

    Regards,

  • pointiee Profile Picture
    21 on at

    Hello @faustocapellanj I've got a similar problem and also tried your advice on this one, but it still doesn't work. Would you mind checking on my topic? https://powerusers.microsoft.com/t5/Using-Flows/MS-Forms-response-should-be-subject-line/m-p/1948707

     

    Thank you!!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard