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

Displaying TimeStamp on Sharepoint List

Hello Guys,

 

I am building a tracker in which I want to display the current timestamp on my powerapps and insert it on my sharepoint. 

I already displayed the time using the 

error.png

 1.PNG

and my column type on my sharepoint list is Date&Time.

Formula.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

And when I clicked the Submit button using SubmitForm(Insert) it creating a new item on my sharepoint list but not on my Submission_Time. 

Can someone help me on how can I display my timestamp on my sharepoint list?

 

Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions

Ok @Marlin-A ,

It is only the mathematics needing fixing - I was trying to give you examples.

I am not sure that you mean about not converting it - you are in Western Australia (I assume) and your SharePoint site is set for somewhere in Western US/Canada - so you have 15 hours difference. If you patch (and I just tested this and got 15 hours ahead)

DateAdd(Now(),15,Hours)

your SharePoint server will add that to its time in the Rocky Mountains and patch the current time in West Oz.
As mentioned if you have users elsewhere in the world - again I hope this is right calc, but you will get the idea - Patch

DateAdd(Now(),7-(TimeZoneOffset(Now())/60),Hours)

This will add 7 to the 8 you are in front (double minus) 7 minus (-8) = 15.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

View solution in original post

22 REPLIES 22
Super User III
Super User III

Hi @Marlin-A ,

A bit confusing below - where are you trying to display this?

Do you want it as text in the fields Name and/or Description in addition to the text already there?

Type is a drop-down, so that cannot be a Date field?

Hello again sir @WarrenBelz ,

 

I am displaying the timestamp on the Submission_Time column which is a Data&Time type.

1.PNG

 

 

 

 

 

 

 

 

 

I just pick the View Text instead to Edit date/time, that's why I got a text on my field.

because I want to display the timestamp automatically based on the current time then submit it into sharepoint column which is on the Submission_Time column.

 

 

Thank you!

Ok @Marlin-A ,

Assuming it is not displayed on the screen already, put in a card for the field and hide it.

Make the Default Now(). You could put in some logic

If(
   IncludeTime.Value = true,   //change to your control name
   Now()
)

By timezone in West Oz?

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hello @WarrenBelz ,

 

Got a little confused on the logic. 
what I did now is make it a normal one which is this.

1.PNG

 

 

 

so what I want now is to display my current date/time which is GMT+8.

 

Thank you!

Helper IV
Helper IV

Hello sir @WarrenBelz ,

*Update

 

Finally got display the date&time on my sharepoint list by having my Date/Time Column to have a default value. 
but the problem right now is that on my gallery is displaying the correct time which is based on my current time.

1.PNG

 

 

but on my sharepoint list it displays this

error.png

 

can someone help me to modify the time to become it GMT+8 or will be based on my current time? 

 

Thank you!

Hi @Marlin-A ,

Just offline for a couple of hours.

The problem you have doing it in SharePoint is exactly what you are experiencing.

The PowerApps solution you have three controls - slipped my mind in my first suggestion.

So the DefaultDate of the Date box is

Now()

The Default of the Hour box

Text(Hour(Now()),"[$-en-US]00")

The Default of the Minute box

Text(Minute(Now()),"[$-en-US]00")

The Update of the card will then take care of the SubmitForm writing back the values.

One last thing - you can also reset the three controls before the SubmitForm - that will get the actual time it was saved.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

Hi @Marlin-A ,

Based on the needs that you mentioned, I think it is not necessary to change control type of the Submission_Time field from "Edit date/time" into "View text" option.

 

Please remain the "Edit date/time" control type for Submission_Time field within your Edit form. Then configure default value for Submission_Time field within your Edit form as below:

5.JPG

 

6.JPG

 

7.JPG

Set the DefaultDate property of the DatePicker control within the Submission_Time field data card to following:

If(EditForm1.Mode= FormMode.New,Now(),Parent.Default)

set the Default property of the HourDropdown box within the Submission_Time field data card to following:

If(EditForm1.Mode = FormMode.New,Text(Now(),"[$-en-US]hh"),Text(Hour(Parent.Default),"[$-en-US]00"))

set the Default property of the MinuteDropdown box within the Submission_Time field data card to following:

If(EditForm1.Mode = FormMode.New,Right(Text(Now(), "[$-en-US]hh:mm"),2),Text(Minute(Parent.Default),"[$-en-US]00"))

 

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.

Hello @v-xida-msft , 

 

Thanks to this I also tried this before and yet I am having a problem on making this into a 12hour not in 24 hour and also if it is AM or PM.

 

Thank you!

Hi @Marlin-A ,

Do you want to make the Submission_Time field as a 12 hour format rather than 24 hour?

 

Based on the needs that you mentioned, I think you could consider add a Dropdown box inside the Submission_Time data card in your Edit form, with available options -- "AM" and "PM" as below:

8.JPG

set the Default property of the HourFormat Dropdown box to following:

If(
    Hour(Now()) > 12,
    "PM",
    "AM"
)

 

set the Default property of the HourDropdown box to following:

If(
    EditForm1.Mode = FormMode.New,
    If(Hour(Now())>12, If(Len(Text(Hour(Now())-12))>2,Text(Hour(Now())-12),"0"&Text(Hour(Now())-12)), If(Len(Text(Hour(Now())))>2,Text(Hour(Now())),"0"&Text(Hour(Now())))),
    If(Hour(Parent.Default)>12, If(Len(Text(Hour(Parent.Default)-12))>2,Text(Hour(Parent.Default)-12),"0"&Text(Hour(Parent.Default)-12)), If(Len(Text(Hour(Parent.Default)))>2,Text(Hour(Parent.Default)),"0"&Text(Hour(Parent.Default))))
)

set the Items property of the HourDropdown box to following:

["00","01","02","03","04","05","06","07","08","09","10","11","12"]

 

Set the Update property of the Submission field data card to following:

DateValue1.SelectedDate + Time(Value(HourValue1.Selected.Value)+If(HourFormat.Selected.Value = "PM",12,0), Value(MinuteValue1.Selected.Value), 0)

 

Please take a try with above solution, 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.

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (21,475)