cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
A_Shirani
Level: Powered On

Sending dates from PowerApps > Flow > Sharepoint Library

Any help on the following is appreciated as I am not sure if my mistake is in PowerApps, Flow or SharePoint.?

 

I am loading a document from PowerApps into a SharePoint online library, using Flow, composing and parsing a JSON function, then "Create File" under the Sharepoint actions. This is working well.

 

I am then adding some metadata on the PowerApps page, mostly text inputs. In Flow these are first initialised as string variables, when the flow runs it passes the variables to the "Update File Properties" also under the SharePoint actions.  So for each file created the flow gets the ID and updates with the properties. This also works fine.

 

My problem comes when I try and add a datepicker to the PowerApps page because I want to set the documents date in the metadata. The date picker is set to "local" if that is relevant? When I run the app the flow does show the variable is set to the date from PowerApps as a string value (e.g. dd/MM/yyyy format) . However when it tries to update the file properties in SharePoint I get an error that "String was not recognised as a valid DateTime". I have tried asking for the date directly in the "Update File Properties" control but I get the same response.

 

At one point I tried converting the SharePoint date column into single line text column, the flow then worked but of course I lose the date functionaility I want in SharePoint. I am presuming I have some sort of date format conflict between the value from PowerApps (string type) and the SharePoint Column (date type)?

A few screen shots below.

Any ideas what I am doing wrong and how to fix it would be great.

 

 

InkedPowerApps flow run_LI.jpgRunning flow from PowerAppsFlow initialise date variable.JPGDate initialised as a variableFlow update file properties.JPGDate variable being used in Update File PropertiesFlow run result.JPGResult of unsuccesful Flow run

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Sending dates from PowerApps > Flow > Sharepoint Library

Hi @A_Shirani ,

When you defined a String variable in your flow to receive the date value passed from your app, the passed date value would be converted into a Text string value.

 

Within the "Update File Properties" action, the DocReceiptDate column is required to provide a date time value rather than a Text string value.

 

Actually, it is not necessary to convert the Date time column into Text type column within your SP Library, instead, you just need to convert the date string value into date time value within your flow, then pass the converted date value for the DocReceiptDate column.

 

I have made a test on my side, please take a try with the following workaround:3.JPG

The flow works well as below:4.JPG

Within the "Compose" action, set the Inputs field to following formula:

formatDateTime(concat(split(variables('varReceiptDate'),'/')[1],'/',split(variables('varReceiptDate'),'/')[0],'/',split(variables('varReceiptDate'),'/')[2]), 'MM/dd/yyyy HH:mm:ss')

On your side, within the "Update File Properties" action, set the DocReceiptDate field to following formula:

formatDateTime(concat(split(variables('varReceiptDate'),'/')[1], '/', split(variables('varReceiptDate'),'/')[0], '/', split(variables('varReceiptDate'),'/')[2]), 'MM/dd/yyyy HH:mm:ss')

More details about the fortmatDateTime() function in flow expression, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#f...

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

2 REPLIES 2
Community Support Team
Community Support Team

Re: Sending dates from PowerApps > Flow > Sharepoint Library

Hi @A_Shirani ,

When you defined a String variable in your flow to receive the date value passed from your app, the passed date value would be converted into a Text string value.

 

Within the "Update File Properties" action, the DocReceiptDate column is required to provide a date time value rather than a Text string value.

 

Actually, it is not necessary to convert the Date time column into Text type column within your SP Library, instead, you just need to convert the date string value into date time value within your flow, then pass the converted date value for the DocReceiptDate column.

 

I have made a test on my side, please take a try with the following workaround:3.JPG

The flow works well as below:4.JPG

Within the "Compose" action, set the Inputs field to following formula:

formatDateTime(concat(split(variables('varReceiptDate'),'/')[1],'/',split(variables('varReceiptDate'),'/')[0],'/',split(variables('varReceiptDate'),'/')[2]), 'MM/dd/yyyy HH:mm:ss')

On your side, within the "Update File Properties" action, set the DocReceiptDate field to following formula:

formatDateTime(concat(split(variables('varReceiptDate'),'/')[1], '/', split(variables('varReceiptDate'),'/')[0], '/', split(variables('varReceiptDate'),'/')[2]), 'MM/dd/yyyy HH:mm:ss')

More details about the fortmatDateTime() function in flow expression, please check the following article:

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#f...

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
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

A_Shirani
Level: Powered On

Re: Sending dates from PowerApps > Flow > Sharepoint Library

Updated my flow and it works perfectly.

Thanks for the help, I would have been stuck on that for a long time without it!

Just a note - I composed the datetime as per your expression, I then used the output of the compose in the Update File Properties.

 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,681)