cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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 III
Dual Super User III

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 III
Dual Super User III

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
Helper IV
Helper IV

Re: Receive STRING and then write in SharePoint as Date

@yashag2255  Thanks, solved!!

Helpful resources

Announcements
Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Top Solution Authors
Users online (8,906)