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
October Events

Mark Your Calendars

So many events happening this month - don't miss out!

 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.

Top Solution Authors
Users online (2,674)