Hello,
I'm trying to create a flow to import an Excel sheet into a Sharepoint list. My Excel contains a date column, but that is formatted as a string and not in the right (M/D/YYYY) format so that Sharepoint understands the input. I added a compose action to convert my current format dd-mm-YYYY to M/D/YYYY, but whatever I try I do not seem to get the right syntax. I tried several methods, so I hope someone can point me to the right one.
I tried:
Input:
"@formatDateTime(body('Get_row')['@{items('Apply_to_each_3')?['Einddatum']}'],'M/D/YYYY')"
Error:
Input:
"@split(triggerBody()['@{items('Apply_to_each_3')?['Einddatum']}'], "-")'"
Ouput:
"@split(triggerBody()['31-12-2006'], "-")'"
Input:
"@split(@items('Apply_to_each_3')?['Einddatum'], "-")"
Output:
"@split(@items('Apply_to_each_3')?['Einddatum'], "-")"
Any help is appreciated.
Solved! Go to Solution.
I finally managed to get this working. Apparently you have to create multiple compose actions to achieve this.
The flow now looks like this:
It would be much easier to tell Sharepoint what the input format is (like: dd-mm-yyyy) and let it store it the way it wants.
Hi @ thyestes,
Could you please share a screenshot of your flow's configuration?
Do you want to insert the value of “Date” in your excel to a “Date” column in the sharepoint list?
Firstly, when insert value to the “Date” column in the sharepoint list, the action “Create item” of shareponit connector could convert the “Date” with type “dd-mm-YYYY” to type “MM/dd/yyyy” automatically.
I have made a test on my side, the screenshots of my excel table as below:
You could choose the “Date” dynamic content of the “Get rows” action as screenshots below:
The flow would run successfully as screenshots below:
And an item would be created in the sharepoint list as below:
Secondly , if you would like to convert the value of “Date” in your excel before the action “Create item” ,you could refer to workaround below:
The difference of the second flow with the first flow:
formatDateTime(outputs('Compose'),'MM/dd/yyyy')
The flow would run successfully as screenshots below:
The second item would be created in the sharepoint list as below:
You could learn more about the Workflow Definition Language refer to link below:
https://docs.microsoft.com/en-us/azure/logic-apps/logic-apps-workflow-definition-language
Regards,
Alice Zhang
Thanks for the explanation. Unfortunately the the column in Excel is not formatted as date. If it was it would make things much easier, but the Excel file is a dump form another system and the date column is formatted as 'general'. My approach was to split the string into 3 arrays and then format it in the correct way using concat. The 'Einddatum' is a string with 'dd-mm-yyyy' but unfortunately I cannot get the right syntax.
This is my flow:
I finally managed to get this working. Apparently you have to create multiple compose actions to achieve this.
The flow now looks like this:
It would be much easier to tell Sharepoint what the input format is (like: dd-mm-yyyy) and let it store it the way it wants.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
Read the latest about new experiences and capabilities in the Power Automate product blog.
If you are a small business ISV/Reseller, share your thoughts with our research team.
User | Count |
---|---|
26 | |
25 | |
23 | |
22 | |
14 |
User | Count |
---|---|
48 | |
35 | |
35 | |
31 | |
30 |