cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Firemaster4076
Frequent Visitor

Missing date field from a list when sending a v3 email

Good morning/afternoon/evening

 

I have a list which is populated from a form. List is filling in nicely with the dates as shown below

Date from 01/08/2021

Date to 07/08/2021

 

Off the back of this an approval is sent out. within the approval text of

 

@{outputs('Add_from_the_form_details_to_the_list')?['body/Title']} has requested annual leave

From - @{outputs('Add_from_the_form_details_to_the_list')?['body/Datefrom']} to @{outputs('Add_from_the_form_details_to_the_list')?['body/Dateto']}
Consisting of @{outputs('Add_from_the_form_details_to_the_list')?['body/HolidayRequesteddaystotal']} days
This leaves @{outputs('Add_from_the_form_details_to_the_list')?['body/DaysRemaining']} remaining

 

the date from and the date to come out 2021-08-01 instead of the other way around 01-08-2021

 

And then when it is approved an email is then to be sent using the send email notification (V3)

But when you search for the to and from field in the share point list to add to the email message they are no where to be seen all the other fields are present.

 

Firemaster4076_0-1628246800479.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ekarim2020
Resident Rockstar
Resident Rockstar

To get to real power of Power Automate you will need to learn how to use expressions. Most things you may want to do are just not possible without expressions. See Introduction to expressions in Power Automate for some weekend reading!

However, you could try to copy and paste the following code:

 

 

From - @{formatDateTime(outputs('Add_from_the_form_details_to_the_list')?['body/Datefrom'], 'dd-MM-yyyy')} to  @{formatDateTime(outputs('Add_from_the_form_details_to_the_list')?['body/Dateto'], 'dd-MM-yyyy')}

 

 

into the Start and Wait for approval action (clear out what is already there, and place the cursor at the start of a new line):

ekarim2020_2-1628260473770.png

This should give you the following:

ekarim2020_1-1628260100677.png

This should work - assuming I have got your data properties for the from and to field correct.

>>>On a side note why did it not just list them?

Power Automate is trying to be clever and tried to anticipate what it thinks you need. It doesn't always get it right. If you don't see the dynamic content you are looking for always try a search!

Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
ekarim2020
Resident Rockstar
Resident Rockstar

For dates you can use the formatDateTime function to get the format you need:

 

formatDateTime(outputs('Get_Form_response_details')?['body/submitDate'], 'dd-MM-yyyy h:mm tt')
formatDateTime(outputs('Add_from_the_form_details_to_the_list')?['body/Datefrom'], 'dd-MM-yyyy')

 

 ekarim2020_0-1628253453497.png

When you say you searched for the To and From dynamic content, did you enter the the names of the field in the Dynamic content search box:

ekarim2020_2-1628253831930.png

Ellis

 


@ekarim2020 wrote:

For dates you can use the formatDateTime function to get the format you need:

 

 

formatDateTime(outputs('Get_Form_response_details')?['body/submitDate'], 'dd-MM-yyyy h:mm tt')
formatDateTime(outputs('Add_from_the_form_details_to_the_list')?['body/Datefrom'], 'dd-MM-yyyy')

 

 


Sorry not sure how I use the Format date (The above) with the date from and date to fields, could you help a complete newbie with this

 

 

Cant believe it just physically searching for the fields shows them geez how easy was that.

On a side note why did it not just list them?

ekarim2020
Resident Rockstar
Resident Rockstar

To get to real power of Power Automate you will need to learn how to use expressions. Most things you may want to do are just not possible without expressions. See Introduction to expressions in Power Automate for some weekend reading!

However, you could try to copy and paste the following code:

 

 

From - @{formatDateTime(outputs('Add_from_the_form_details_to_the_list')?['body/Datefrom'], 'dd-MM-yyyy')} to  @{formatDateTime(outputs('Add_from_the_form_details_to_the_list')?['body/Dateto'], 'dd-MM-yyyy')}

 

 

into the Start and Wait for approval action (clear out what is already there, and place the cursor at the start of a new line):

ekarim2020_2-1628260473770.png

This should give you the following:

ekarim2020_1-1628260100677.png

This should work - assuming I have got your data properties for the from and to field correct.

>>>On a side note why did it not just list them?

Power Automate is trying to be clever and tried to anticipate what it thinks you need. It doesn't always get it right. If you don't see the dynamic content you are looking for always try a search!

Ellis
____________________________________
If I have answered your question, please mark the post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

brilliant ekarim, i will take that as my homework and then pick the expression apart so i can see the workings. it is now getting the right date format cheers

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!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,897)