cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Rafi
Level: Power Up

How to get the date value from the Email Subject

Problem:

Please tell how to extrac the date value from the email subject. Below is the JSON output of email. I am trying to get the date and create a task with the journey date. Thanks in Advance.

 

Approach tried:

split(triggerBody()?['Subject'],',')

For the above code i am getting the error"
InvalidTemplate. Unable to process template language expressions in action 'Create_a_task' inputs at line '1' and column '2595': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#split for usage details.'."

 

Sample Data:

[
{
"From": "***@live.com",
"To": "***@live.com",
"Cc": null,
"Bcc": null,
"Subject": "Booking Confirmation, Train: 22623, 09-Aug-2019, SL, MS - DG",
"Body": "",
"Importance": 1,
"BodyPreview": "",
"HasAttachment": false,
"Id": "AQMkADAwATMwMAItOWRjMC00ZjI5LTAwAi0wMAoARgAAA7oC8kwhN2BFvJysi0nocpAHAGald1OfnM1MrdeP4PRZjzEAAAIBDAAAAGald1OfnM1MrdeP4PRZjzEAAnuH4CwAAAA=",
"ConversationId": "AQQkADAwATMwMAItOWRjMC00ZjI5LTAwAi0wMAoAEACxX1xF0Hq1RYeyK_vfH-fZ",
"DateTimeReceived": "2019-06-10T11:25:23+00:00",
"IsRead": false,
"Attachments": [],
"IsHtml": true
}
]

1 ACCEPTED SOLUTION

Accepted Solutions
SCTdan
Level 8

Re: How to get the date value from the Email Subject

How are you getting that email / JSON data into your flow (what trigger)?

 

---

 

Based on your sample data there, assuming you're getting that in as raw JSON array.

You'll need to parse it first (via Parse JSON action), then split it using this

 

split(body('Parse_json')[0]?['Subject'],',')

 

xZDFqMz

 

View solution in original post

2 REPLIES 2
SCTdan
Level 8

Re: How to get the date value from the Email Subject

How are you getting that email / JSON data into your flow (what trigger)?

 

---

 

Based on your sample data there, assuming you're getting that in as raw JSON array.

You'll need to parse it first (via Parse JSON action), then split it using this

 

split(body('Parse_json')[0]?['Subject'],',')

 

xZDFqMz

 

View solution in original post

Rafi
Level: Power Up

Re: How to get the date value from the Email Subject

Thank you @SCTdan

I overlooked ParseJSON action that caused the issue. Now its perfect.

Thanks for sharing your knowledge. Appreciate it!

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Watch the event on demand 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: 294 members 3,597 guests
Please welcome our newest community members: