cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
MichaelAnnis
Memorable Member
Memorable Member

%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
shindomo
Continued Contributor
Continued Contributor

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
shindomo
Continued Contributor
Continued Contributor

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

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

shindomo
Continued Contributor
Continued Contributor

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,421)