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 / Increment Number based...
Power Apps
Unanswered

Increment Number based on Day

(0) ShareShare
ReportReport
Posted on by 82

How can I reset the incremental number to 1 when the day changes to next day. 

 

1 = incremental number (batch number of the day) 

when the day changes to say tomorrow, increment number should again start from 1. During the day it should increment +1.

 

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    154,399 Most Valuable Professional on at

    Hi @PowerDigitize_1 ,

    One way would be a reference list (one record only) with a date and a number. Test for the date

    With(
     {wRef:First(ReferenceList)},
     If(
     wRef.DateField = Today(),
     Set(
     YourNumber,
     wRef.NumberField
     );
     Patch(
     ReferenceList,
     {ID: wRef.ID},
     (NumberField: wRef.NumberField + 1}
     ),
     Set(
     YourNumber,
     1
     );
     Patch(
     ReferenceList,
     {ID: wRef.ID},
     (NumberField: 1}
     )
     )
     )
    )

     

    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.

    Visit my blog Practical Power Apps

  • Hmaldonado Profile Picture
    21 on at

    I tried this approach but when the day changes, does not update the date in the ReferenceList?

     

    With
    (
     {wRef:LookUp(ReferenceList,Title=ComboBoxWithTitles.Selected.Value)},
    
    If
     (wRef.DateField=Today(),
     Set(VarSequence,wRef.NumberField);Patch(ReferenceList,{ID:wRef.ID},{NumberField:wRef.NumberField+1}),
     Set(VarSequence,1);Set(VarReference,wRef.Title);
     )
    );

    How i can overcome that?

  • Hmaldonado Profile Picture
    21 on at

    I found the answer, the problem is that I need to update the date and the numberfield to 2 since 1 is used in the code.

     

    ith
    (
     {wRef:LookUp(ReferenceList,Title=Dropdown.Selected.Value)},
    
    If
     (wRef.DateField=Today(),
     Set(VarSequence,wRef.NumberField);Patch(ReferenceList,{ID:wRef.ID},{NumberField:wRef.NumberField+1}),
    
     Set(VarSequence,1);Set(VarReference,wRef.Title);Patch(ReferenceList,{ID: wRef.ID}, ({NumberField: 2}),({DateField: Today()}))
     )
    );

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard