cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Advocate II
Advocate II

Receive STRING and then write in SharePoint as Date

Hi All,

 

i have an Excel table that contains information I need to be written into SharePoint List. One of the parameters is a date, see picture below. The input in Excel is dd-mm-yyyy or d-mm-yyyy (can't change that, it is owned by someone else)

 

a-excel table.JPG

 

 

 

 

 

 

 

 

 

My Flow pulls the RawData using a "get row" action:


a-get-row.JPG

 

 

 

 

 

 

 

 

I then try to write it into my SharePoint List where the filed is formatted as Date/Time (Date only, standard format). using Create Item action:

 

a-create1.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I get following error message:


a-error-1.JPG

 

 

 

 

 

 

 

I then use formula formatDateTime(body('Get_a_row_RawDataGenerationDate')?['Value']) to transform my Excel info and write again:


a-create2.JPG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Now I get following error message:

a-error-2.JPG

 

 

 

 

 

 

What am I doing wrong? how can I transform the received value from Excel into a DateTime format that will be accepted into the Create Item action?

 

Any feedback is greatly appreciared!

 

Regards

Charles

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Dual Super User
Dual Super User

Re: Receive STRING and then write in SharePoint as Date

Hey @Charles-v-D 

 

1. In Flow, all date time related stuff needs the string to be formatted as the ISO8601 format that goes as: yyyy-MM-ddThh:mm:ssz. 

In your case, you have the date format as dd-MM-yyyy and that is why it is not recognising it as an appropriate date. You can do some string manipulations to get it to that format as: ff4.PNG

Here, I have variable as a sample. You can either set a variable or directly apply the formula on the dynamic value for the compose action. 

concat(split(variables('ss'),'-')[2],'-',split(variables('ss'),'-')[1],'-',split(variables('ss'),'-')[0])

2. Now you can check the SP list column date formatting and use the formatDateTime expression to convert the output of the above formula. If the format on the SP column is yyyy-MM-dd then you can skip this step and directly point the above output there. 

 

Hope this Helps!

 

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!

 

 

 

View solution in original post

2 REPLIES 2
Highlighted
Dual Super User
Dual Super User

Re: Receive STRING and then write in SharePoint as Date

Hey @Charles-v-D 

 

1. In Flow, all date time related stuff needs the string to be formatted as the ISO8601 format that goes as: yyyy-MM-ddThh:mm:ssz. 

In your case, you have the date format as dd-MM-yyyy and that is why it is not recognising it as an appropriate date. You can do some string manipulations to get it to that format as: ff4.PNG

Here, I have variable as a sample. You can either set a variable or directly apply the formula on the dynamic value for the compose action. 

concat(split(variables('ss'),'-')[2],'-',split(variables('ss'),'-')[1],'-',split(variables('ss'),'-')[0])

2. Now you can check the SP list column date formatting and use the formatDateTime expression to convert the output of the above formula. If the format on the SP column is yyyy-MM-dd then you can skip this step and directly point the above output there. 

 

Hope this Helps!

 

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!

 

 

 

View solution in original post

Highlighted
Advocate II
Advocate II

Re: Receive STRING and then write in SharePoint as Date

@yashag2255  Thanks, solved!!

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

Top Solution Authors
Top Kudoed Authors
Users online (7,414)