web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / ID Time Stamp not working
Power Apps
Answered

ID Time Stamp not working

(0) ShareShare
ReportReport
Posted on by 383

I have a parent table called Orders that's a SharePoint List and a child table SharePoints List called Equipment. Orders has an Order ID- and the Equipment table has the Order ID plus Equipment ID. The Order ID represents the unique SharePoint ID for the list Orders. Equipment ID is a timestamp for when the equipment selected information is filled out specific for that order. It's impossible to fill out two equipment's information at the same time for an order, so that's why I have a timestamp for the equipment ID.

 

The equipment ID is the following in the Default property for the field:

Text(Now(),"ddmmyy-hhmmss")

 

For each order though, the timestamp is the same for all the equipment, despite filling out the information and saving at different times. It's the same intake form for all the equipment. I think it's saving the original timestamp as the default value when accessing the form during the same session. Is there a way to reset the timestamp each time I go to the intake form screen so I get a new value?

 

Many thanks!

Categories:
I have the same question (0)
  • Verified answer
    TheRobRush Profile Picture
    11,128 Moderator on at

    The way powerapps works once you call the Now() in an app it does not change again until theres a certain kind of refresh. it's a very weird thing that I have never bothered fully understanding. BUT all you need to do is put a time anywhere in your app, make it

    Repeat:ON

    Auto Start: On

    Auto pause: On

    Duration: 100

    Visible: False

     

    and set ontimerend to

    Set(timeStamp,Text(Now(),"ddmmyy-hhmmss"))

     

    now instead of Set(timeStamp,Text(Now(),"ddmmyy-hhmmss")) in your patch etc just reference timeStamp

  • Kirsten2 Profile Picture
    383 on at

    Thanks! Where is the Repeat, etc. properties in Power Apps? I clicked the DataCardValue for that field and do not see those options under properties. Thanks again for your help!

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Those are on your timer control, not a datacard

  • TheRobRush Profile Picture
    11,128 Moderator on at

    Everything above is related to placing a timer* control in the app anywhere and hiding it, just noticed original post i typoed that to time* which could be confusing haha

  • Kirsten2 Profile Picture
    383 on at

    Thanks! I was not aware of that control before.

     

    I am making kind of a complicated app where there is a create order section and a review section of the order. Both places they can edit/add equipment to their order. I wonder if they revisit and edit their order, will that just create an new ID instead of replacing the current ID that they just want to edit? How would that work if the ID is always reseting even for items that can be later edited. There will be an option to add, delete, or edit items in their shopping cart in both sections. Is there a better way to be doing IDs?Thanks for your input/advice on this!

     

    I'll try it first though to see if it works!

  • Kirsten2 Profile Picture
    383 on at

    Nevermind. Ignore my previous comment. I think it will work if I switch what I refer my patch function to, the field ID value or the timestamp, depending on whether it's a new or edited item. I think I understand how to do it now!

  • Kirsten2 Profile Picture
    383 on at

    I am trying to set the field with the variable timestamp in the Default property, instead of directly into the patch function, but it is not saving any value in that field. Do you know how to correct that?

     

    Default property:

    timestamp

     

    Also tried Default property:

    text(timestamp)

     

    It's easier for me to edit the field than the patch function. 

  • Kirsten2 Profile Picture
    383 on at

    I changed the following on the Timer control:

     

    Repeat: true

    Auto Start: true

    Auto pause: true

    Duration: 100

    Visible: False

    OnTimerEnd: 

    Set(timeStamp,Text(Now(),"ddmmyy-hhmmss"))


    My patch function is the following: 

    Patch(Equipment, Defaults(Equipment),{ColumnName1: DataCardValue45.Text, ColumnName2: DataCardValue46.Text, 'Order ID ':DataCardValue28.Text, 'Equipment ID':DataCardValue29.Text, EQID:DataCardValue24EQID.Text})

     

    EQID is the combination of Order ID and Equipment ID (timestamp) to refer to one column as the unique ID for the entire record. 

     

    Instead of updating the reference to timestamp variable for Equipment ID and updating the EQID as well in the patch, I just tried updating the Default property for the Equipment ID to timestamp on the form, but nothing is appearing in the field, and when I use the patch, it doesn't give a text. It is just blank on the SharePoint list. What am I doing wrong?

     

    I also tried updating the patch function to the following:

    Patch(Equipment, Defaults(Equipment),{ColumnName1: DataCardValue45.Text, ColumnName2: DataCardValue46.Text, 'Order ID ':DataCardValue28.Text, 'Equipment ID':timestamp, EQID:DataCardValue28.Text&timestamp})

     

    The SharePoint list is also blank for Equipment ID.

     

    Many thanks for your help!

  • TheRobRush Profile Picture
    11,128 Moderator on at

    If your timer happens to be on a different screen you will need to set autopause to false.

     

    Next thing I would try is next to your form, on the same screen, put a textlabel and set it to

    DataCardValue45.Text

     

    make sure that ones showing proper, then try DataCardValue46.Text and so on until you have checked every one of the references in that first patch. If they all check out, try putting a button outside the form and put JUST the patch on its onselect and see if that has a different result WHILE form is loaded up. IF one of those references is incorrect in the text label then we know which one to look further into.

    also palce a label with timeStamp nearby so you can wathc it constantly updating

  • Kirsten2 Profile Picture
    383 on at

    Thanks! I changed AutoPause to false. My timer is on the Home Screen, because I have four different input forms for the equipment that has different fields dependent on the equipment type. So this would need to work across multiple forms having a timestamp for each equipment that will be filled in for the intake process. I am just testing one of the intake forms right now.

     

    I have the visability of the timer on the Home Screen set to visible now just to see if it's working and the numbers never change. Is that, correct? It always shows "00:00:00". It's like it's not running. 

     

    I am not sure if I am following the below instructions. I know all the other fields are updating correctly when changing them (as I tested it when filling out new information), just not the Equipment ID with the timestamp. 

     

    Thanks again for your help!

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 337 Most Valuable Professional

#2
11manish Profile Picture

11manish 173

#3
Valantis Profile Picture

Valantis 86

Last 30 days Overall leaderboard