Announcements
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 )
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 NogueiraCheck my LinkedIn!Buy me a coffee!Check my User Group (pt-PT)!Last Post on CommunityMy website!
@Nogueira1306 Thank you for your reply. I see there is an error
What does the error say?
@Nogueira1306 text or number expected in Last
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 )
@Nogueira1306 Can you please explain with changes in your last reply ? as I still get the error. Thank you for your time
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 )
@Nogueira1306 I see nothing changed, its not incrementing. Sorry to bother you
For me it is working:
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
@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.
Congratulations to our community stars!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
WarrenBelz 355 Most Valuable Professional
11manish 209 Super User 2026 Season 2
MS.Ragavendar 150 Super User 2026 Season 2