cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichaelAnnis
Super User
Super User

%RetrievedEmails[0].From% (Outlook Message Datatype Property .From) reporting as bad syntax

I clearly have captured .From in my Retrieve Emails:

MichaelAnnis_0-1634339354219.png

Therefore, %RetrievedEmails[0].From% should give me the from e-mail address.

I am trying to use a Switch Case, but every time I try to get .From from an Outlook Email Message, it fails.

 

I have tried to work around it by getting %RetrievedEmails[0]% as it's own variable %CurrentEmail% which was a success and it was read as an individual Outlook Message; however, when I tried to get %CurrentEmail.From% it gave me the same syntax error.  Any syntax error will not allow you to run the PAD flow.

 

MichaelAnnis_1-1634339607615.png

Anybody know why .From is not working when it is clearly stated as a property in the first image and listed as an available property here:
https://docs.microsoft.com/en-us/power-automate/desktop-flows/datatype-properties#outlook-mail-messa...

Any help would be appreciated.

Thanks,


Mike

 

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Hello @MichaelAnnis 

 

I could retrieve the from email address using %RetrievedEmails[0]['From']%.

However, I have to agree with the feeling of strangeness you felt.

 

%RetrievedEmails[0]['From']%
%RetrievedEmails[0].Date%
%RetrievedEmails[0].Subject%

 

I wonder why ".From" cause syntax error, while ".Date" or ".Subject" is working with no problem?

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hello @MichaelAnnis 

 

I could retrieve the from email address using %RetrievedEmails[0]['From']%.

However, I have to agree with the feeling of strangeness you felt.

 

%RetrievedEmails[0]['From']%
%RetrievedEmails[0].Date%
%RetrievedEmails[0].Subject%

 

I wonder why ".From" cause syntax error, while ".Date" or ".Subject" is working with no problem?

That worked perfectly.  Thank you @Anonymous .  I have no idea how you figured that out.  I tried so many different things.  Thanks again.

Anonymous
Not applicable

Hello @MichaelAnnis 

 

Good to hear it worked. 🙂

 

How I figured it out:

 

[1] Use any action to refer infromation of the current Email message, such like "Display message" for example. Click {x} icon to bring "Select variable" fly-out menu.

 

shindomo_0-1634675562630.png

 

[2] You will find the variable "CurrentEmail" which type is "Outlook email message" and storing email properties such like .To, .Cc, .Bcc, .Body, etc. Of course there is property .From as you already know.

 

shindomo_1-1634675767337.png

 

[3] Choose property .From and click [Select] button.

 

shindomo_2-1634676162209.png

 

[4] Now we can see the actual syntax of .From property is %CurrentEmail['From']%.

 

shindomo_3-1634676239804.png

 

That's it. Thank you.

Did not know you could do that from that window...That's cool.  I've always directed people to the variable pane on the right to find that info.  Thanks again.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

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

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Top Kudoed Authors
Users online (3,676)