cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TomasG
Level: Powered On

How to retrieve email from ODATA format, required for sending e-mail

Hi, I have problem with sending email to specific address. 

Brief description: I retrieve items which have email address. I grouped it together and send email with all items to one email address.

 

I was inspired by this procedure: https://powerusers.microsoft.com/t5/Building-Flows/flow-to-send-single-email-for-set-of-records-in-S...

 

Everything works except sending an email. It takes email address in ODATA format (maybe this is the problem). In action "sending email" the output of this action looks like:

"To": {"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"example@example.cz"}; 


and alert is: BadRequest., and some of the reciever are not valid. 

But when I write only example@example.cz, into the box TO, it works without trouble. 
So it is necessary to trim this output? or problem is somewhere else? 

 

Now I have this solution's output:

Bez názvu.png

 

and this is solution: 

Výstřižek.JPG

Current item bears data as I mentioned above: "@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"example@example.cz"

 

Have anybody experience with this? Thanks for answers.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: How to retrieve email from ODATA format, required for sending e-mail

Hi @TomasG ,

 

I guess this is because you did not configure Choice value in the Value field when configuring Append to array variable action.

Generally for Choice column, if you need to reference the field value, you need to reference Choice column value.

 

For example, the type of Email column is Choice:

32.PNG

If you filter the items through Filter array and use Expression to get the field values, you need to configure the following expression:

item()['Email']['Value']

33.PNG

 

 

Or you could keep your current configuration and solve your problem with Parse JSON action:

  • Fill the following content in the location shown to generate the schema.
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"example@example.cz"}

34.PNG

  • Then configure Dynamic content originally configured in To field in Content.
  • Finally, the resolved Value is configured in To field, which is the required email address.

35.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Super User
Super User

Re: How to retrieve email from ODATA format, required for sending e-mail

If you'll review the Send an email (V2) documentation, it states: 

To email
Specify email addresses separated by semicolons like someone@contoso.com
Key: To

I believe the issue you're having is the format of the data you are trying to pass into the to box. Have you tried initializing a string variable with the email address data and passing the variable into the To box?

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support Team
Community Support Team

Re: How to retrieve email from ODATA format, required for sending e-mail

Hi @TomasG ,

 

I guess this is because you did not configure Choice value in the Value field when configuring Append to array variable action.

Generally for Choice column, if you need to reference the field value, you need to reference Choice column value.

 

For example, the type of Email column is Choice:

32.PNG

If you filter the items through Filter array and use Expression to get the field values, you need to configure the following expression:

item()['Email']['Value']

33.PNG

 

 

Or you could keep your current configuration and solve your problem with Parse JSON action:

  • Fill the following content in the location shown to generate the schema.
{"@odata.type":"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference","Id":1,"Value":"example@example.cz"}

34.PNG

  • Then configure Dynamic content originally configured in To field in Content.
  • Finally, the resolved Value is configured in To field, which is the required email address.

35.PNG

 

Please take a try.

 

Best Regards,

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

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 201 members 4,596 guests
Please welcome our newest community members: