cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
RP2
Helper I
Helper I

Trouble pulling SharePoint Data.

Hello all, 


I'm trying to pull data from a SharePoint list to send automated emails a selected intervals however, I'm having some trouble pulling the data. 

 

I'm trying to use a compose card to pull data from SharePoint to send automated emails at certain intervals. 

1. formatdatetime(triggerBody()?['Assign_x0020_Date'],'dddd MM/dd/yyyy')

2. formatdatetime(triggerBody()?['Deadline_x002f_Date_x0020'],'dddd MM/dd/yyyy')

 

I've tried to use the two expressions above as compose cards. The SharePoint data consists of 6 columns: Title, Email, AssignDate, Reminder 1 , Reminder 2, DeadlineDate. I'm trying to create the compose cards as AssignDate and DeadlineDate so I can put them in the body of the email as dynamic data. Sample below:

 

Delay Until Card - Reminder 1 

Send Outlook Email Card:

Hello, "Title" (dynamic data from SharePoint list)

 

This is your reminder to update the ticket status 

The ticket was assigned on "AssignDate" (dynamic data from SharePoint - Compose 1) 

The ticket resolution deadline is "DeadlineDate" (dynamic data from SharePoint - Compose 2) 

 

Any suggestions? I want to ensure the time and date format are MM/DD/YYYY

Note: please disregard the fact that there is no email field in SharePoint and that the wording is different in the email body.

 

SP.PNGFlowEd.png

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @RP2 ,

 

Please take a try to create flow was my screenshot below:

1.png

 

Expression in the Compose 3:

formatDateTime(outputs('Compose'),'dddd MM/dd/yyyy')

 

Expression in the Compose 4:

formatDateTime(outputs('Compose_2'),'dddd MM/dd/yyyy')

 

Best regards,

Alice       

 

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

View solution in original post

4 REPLIES 4
RP2
Helper I
Helper I

This is the error I'm receiving at the first compose action: 

 

InvalidTemplate. Unable to process template language expressions in action 'AssignDate_(Compose)' inputs at line '1' and column '2784': 'The template language function 'formatdatetime' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#formatdatetime for usage details.'.
 
 
 

Hi @RP2 

I was able to replicate your scenario, below are the two screenshots, one with the success and another with the failure message same like yours.

Flow Res DateTimeSuccess.png

 Flow Res DateTimeFailure.png

 The failure happens when I saved an item with the empty value for the 'AssignDate' field. Check whether the field is empty or not, if you are sure that all the items has the value for the field, then check the internal name of the field by navigating to the list settings and click on the field name, you can find the actual internal name at the end of the URL address. Please verify and let us know.

 

Hope it helps, please like it or mark it as a solution if it resolves ur clarification or issue
-Sudharsan K...

 

 

Hope it helps, please like it or mark it as a solution if it resolves your clarification or issue
-Sudharsan K...
v-alzhan-msft
Community Support
Community Support

Hi @RP2 ,

 

Please take a try to create flow was my screenshot below:

1.png

 

Expression in the Compose 3:

formatDateTime(outputs('Compose'),'dddd MM/dd/yyyy')

 

Expression in the Compose 4:

formatDateTime(outputs('Compose_2'),'dddd MM/dd/yyyy')

 

Best regards,

Alice       

 

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

View solution in original post

@v-alzhan-msft 

 

Thank you so much! That seemed to do the trick. My only other question is how can I incorporate the time into my email? 

 

I've attached the images referencing my issue. My Flow is extracting the date in the proper format from my SharePoint and being sent in an email (ex. Tuesday 4/14/2020); however, I would like to include the time for that date as well if I can. I am currently on EST. I do have to do some modification on the SharePoint side. For example, when I want to send a message at 12:30PM EST I need to have the notification in SharePoint for 9:30AM, I assume this is because it's using UTC. Any suggestions on how to fix the following would be appreciated.

 

1. How to get SharePoint to recognize standard EST (as of right now I need to set the reminder 3 hours before I actually want it to send. Ex. Set reminder 1 in SharePoint for 9:30AM and I will receive the email at 12:30PM EST.)

2. How to attach the time to my emails (right now I'm getting something like "You will receive a second reminder on Wednesday 04/08/2020." However, I would like it to say "You will receive a second reminder on Wednesday 04/0/2020 at 4:00PM" or whatever the time may be. 

 

Thank you for your help! 

Ticket Example.PNG

 

InkedSP example_LI.jpg

 

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 (2,103)