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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / number increment reset...
Power Apps
Answered

number increment reset annually on given date

(0) ShareShare
ReportReport
Posted on by 725

Hi everyone

I have a number that increments with every new record, eg.. IR 21-29, IR 21-30, IR 21-31 and on the first of October it switches to the next year as the following.. IR 22-32, IR 22-33, IR 22-34, which is good but what I also want is that the last two digits to reset on the 1st of October like..  IR 22-01, IR 22-02, IR 22-03

Sp as Datasource.

Thank you for your time.

Categories:
I have the same question (0)
  • Verified answer
    v-bofeng-msft Profile Picture
    on at

    Hi @Corissandageri :

    Could you please tell me:

    • Is October 1st of each year the first day of each cycle?

    I've made a test for you reference,I assume there is a collection something like:

    ClearCollect(TheList,{ID:"IR 21-01"},{ID:"IR 21-02"},{ID:"IR 21-03"},{ID:"IR 21-04"})

    You could add a row by this formula:

    With(
     {Year:If(Month(Today())>=10,Text(Today(),"yy")+1,Text(Today(),"yy"))},
     If(
     IsBlank(LookUp(TheList,"IR "&Year in ID)),
     Collect(TheList,{ID:"IR "&Year&"-01"}),
     Collect(TheList,{ID:"IR "&Year&"-"&Text(Last(Split(Last(TheList).ID,"-")).Result+1,"00")})
     )
    )

    Best Regards,

    Bof

  • Vedant28 Profile Picture
    90 on at

    hi Bof 

    i am facing the same issue but my code get stopped in november

    i tried two code: 

    code  1 

    If(Month(Today())>=11&&Day(Today())>=1,Dropdown24_1.Selected.Value&"-DIS-"&Year(Today())+1&"-001",Dropdown24_1.Selected.Value&"-DIS-"&Text(DateAdd(Now(),2,Months),"[$-en-US]yyyy")&"-"&Text(Value(TextInput27_5.Text)+1,"[$-en-US]000"))

    Code 2: 

    With(
     {
     wUS_CASE: Dropdown24_1.Selected.Value &"-DIS-"&Year(Today())+1 &"-001",
     wLastID: First(Sort( DISLIST, Case_Number, Descending )).Case_Number
     },
     If(
    	Month(Today()) >= 11 && Day(Today()) >= 1 &&
    	CountRows( Filter( DISLIST, Case_Number = wUS_CASE ) ) = 0,
    	
    	// then case
    	wUS_CASE,
    	
    	// else case
    	Left(wLastID,13) & Text( Value( Right( wLastID,3 )) + 1, "00")
     )
    )

    in both the case i am not able to submit the form after nov 1. Until oct 31 it was working fine.,

     

    thank you in advance

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard