cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jbrit2020
Responsive Resident
Responsive Resident

Saving datetime from Powerapps to Sharepoint

How difficult can this be?

 

I'm using a sharepoint list to save some records from a powerapps app, and I'm trying to save dates on sharepoint.

 

With a sql datasource this works great, no issues whatsoever, but with a sharepoint list when I patch NOW() it will take the Date but it will save the time as 12:00AM.

 

I've tried converting in powerapps and saving it into sharepoint as Text, but then when I try to display the dates in Powerapps and order them, it won't work as they are seen as string and not Date.

 

How do I sort this out? Code below:

 

If(TextInput1_1.Text = "",Reset(TextInput1_1),Patch(ORMActionupdates, Defaults(ORMActionupdates),{Title: actionslog.Actions,Updatedby:User().FullName,UpdatedByEmail:User().Email,Dateupdate:Now() ,meetingupdate:TextInput1_1.Text}));Reset(TextInput1_1)

 Regards,

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User III
Super User III

@jbrit2020 

Yes, this means your PowerApp is working.  Something is not right on the SharePoint side.  So either there is something with the list view you are seeing in SharePoint...has there been any customization?  Or something in the region settings are causing issues.

 

To troubleshoot that further, I would make another test list in the SharePoint site with just a date time column in it.

Then add it to the App as a data source.  Then change the test formula to write the date to the new datasource instead of the other one.  Then look and see what is getting stored in that test list column.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

10 REPLIES 10
StalinPonnusamy
Community Champion
Community Champion

We can convert string to date-time value or Date to string

 

DateTimeValue(string,Language)
Text( DateValue(DateStringValue, "Language" ), DateTimeFormat.LongDate )

 

 

 

Text(DateTimeValue(StringValue,"en-US"),"mm/dd/yyyy HH:mm:ss")

 

 

Any reason, why you have a text field in SP (Its easy to keep as DateTime field type is appropriate)

 

Example:

StalinPonnusamy_0-1627564685430.png

 

RandyHayes
Super User III
Super User III

@jbrit2020 

Are you sure that your Date column in SharePoint is defined to include time also, not just date?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
jbrit2020
Responsive Resident
Responsive Resident

@RandyHayes  Yep it's enabled, when I disable it it only shows Date, with it enabled it shows Date & 12:00AM

RandyHayes
Super User III
Super User III

@jbrit2020 

Is it the Dateupdate column from your formula that is incorrect?

 

If so, I would do the following:

1) Make sure you have refreshed the datasource in the data source list in your PowerApps app

2) Troubleshoot with a simple button added to your app with the OnSelect formula of:

Patch(ORMActionupdates, Defaults(ORMActionupdates), 
   {Title: "Test", 
    Dateupdate: Now()
   }
)

See what happens when you click that button...do you get a new record with the proper date and time in it?

 

Incidentally, you seem to be using a updated by and updated date series of columns for your record - keep in mind that SharePoint already has a Modified By and Modified date that are automatically populated for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
jbrit2020
Responsive Resident
Responsive Resident

@RandyHayes Hi Randy, same result the date that shows up on Sharepoint comes up as "29/07/2021 12:00 AM" instead of what it should show : "29/07/2021 2:55 PM"

RandyHayes
Super User III
Super User III

@jbrit2020 

Very good (actually) - now we have a reproducible test button.  

Now, open your Monitor Tool and then hit the test button.  Look then at the event in the monitor where the record is sent to SharePoint and see what exactly the app is sending to the list. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
jbrit2020
Responsive Resident
Responsive Resident

jbrit2020_0-1627567991333.png

This is the result under "Created Row" on the monitor.

 

It looks like it's sending through the right thing, which means its on Sharepoint side something goes wrong

RandyHayes
Super User III
Super User III

@jbrit2020 

Yes, this means your PowerApp is working.  Something is not right on the SharePoint side.  So either there is something with the list view you are seeing in SharePoint...has there been any customization?  Or something in the region settings are causing issues.

 

To troubleshoot that further, I would make another test list in the SharePoint site with just a date time column in it.

Then add it to the App as a data source.  Then change the test formula to write the date to the new datasource instead of the other one.  Then look and see what is getting stored in that test list column.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

jbrit2020
Responsive Resident
Responsive Resident

No customization at all, an extremely basic Sharepoing list. I don't like to fiddle with Sharepoint settings.

 

I thought about region settings unfortunatelly I don't have admin access to the sharepoint page I'm using...

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,579)