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 auto increment with...
Power Apps
Answered

Id auto increment with prefix

(0) ShareShare
ReportReport
Posted on by 100

Hello,

 

I have been trying to auto increment the id with prefix- though it works without a prefix it doesnt work with a prefix and saves same.

 

If(
Form_JournalScreen.Mode = FormMode.New;
 With(
 {
 wList:
 Sort(
 'Journal Sicherheitsrelevante Ereignisse'.'ID_Jahr/LFdnR';
 Descending
 )
 };
 "2021/ " & 
 Text( 
 Last(wList).'ID_Jahr/LFdnR' + 1
 )
 );
 Parent.Default )

ID_increment.PNG

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    If(
    Form_JournalScreen.Mode = FormMode.New;
     With(
     {
     wList:
     Sort(
     'Journal Sicherheitsrelevante Ereignisse'.'ID_Jahr/LFdnR';
     Descending
     )
     };
     "2021/" & 
     Text( 
     Value(Last(Split(First(wList).'ID_Jahr/LFdnR'; "/"))) + 1
     )
     );
     Parent.Default )

     

    Try that... You were trying to sum text and int, not sure if that was the error but...

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    Buy me a coffee!

    Check my User Group (pt-PT)!

    Last Post on Community

    My website!

  • nithishguptak Profile Picture
    100 on at

    @Nogueira1306 Thank you for your reply. I see there is an error Error.PNG

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    What does the error say?

  • nithishguptak Profile Picture
    100 on at

    @Nogueira1306 text or number expected in Last

     

    Error.PNG

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at
    If(
    Form_JournalScreen.Mode = FormMode.New;
     With(
     {
     wList:
     Sort(
     'Journal Sicherheitsrelevante Ereignisse';
     'ID_Jahr/LFdnR';
     Descending
     )
     };
     "2021/" & 
     Text( 
     Value(Last(Split(First(wList).'ID_Jahr/LFdnR'; "/"))) + 1
     )
     );
     Parent.Default )
  • nithishguptak Profile Picture
    100 on at

    @Nogueira1306 Can you please explain with changes in your last reply ? as I still get the error. Thank you for your time

  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    I changed the Sort function but I think that it was missing a ".Result"

     

    If(
    Form_JournalScreen.Mode = FormMode.New;
     With(
     {
     wList:
     Sort(
     'Journal Sicherheitsrelevante Ereignisse'.'ID_Jahr/LFdnR';
     Descending
     )
     };
     "2021/" & 
     Text( 
     Value(Last(Split(First(wList).'ID_Jahr/LFdnR'; "/")).Result) + 1
     )
     );
     Parent.Default )
  • Verified answer
    nithishguptak Profile Picture
    100 on at

    @Nogueira1306 I see nothing changed, its not incrementing. Sorry to bother you Error.PNG

  • Verified answer
    Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    For me it is working:

     

    Nogueira1306_1-1648037892993.png

     

    Value(Last(Split(First(Sort(Journal Sicherheitsrelevante Ereignisse'; 'ID_Jahr/LFdnR'; Descending)).'ID_Jahr/LFdnR';"/")).Result) + 1

     

     

    If(
    Form_JournalScreen.Mode = FormMode.New;
    "2021/" & Value(Last(Split(First(Sort(Journal Sicherheitsrelevante Ereignisse'; 'ID_Jahr/LFdnR'; Descending)).'ID_Jahr/LFdnR';"/")).Result) + 1;
    Parent.Default

     

  • nithishguptak Profile Picture
    100 on at

    @Nogueira1306 So thing is after its saved in sharepoint it isnt updated in powerapps. I placed a trigger so that it refreshes every time there is new record.

     

    Thank you for your time and being so helpful 

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard