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 / Remove Prefix from Sin...
Power Apps
Answered

Remove Prefix from Single Text Alphanumeric Column, calculate the highest number and add 1

(0) ShareShare
ReportReport
Posted on by

Hi,

I am using PowerApps SharePoint Integration and in my List I have a column called 'Request ID';

 

Request ID

------------

CR30

CR29

CR28

etc

 

What I would like to do is produce the next incremented ID, in this case 'CR31'. The result 'CR31' would simply be displayed in a text box and then that text box value would be used in a Patch function to populate the Request ID column. I'm having a lot of trouble getting this to work and I've tried the Substitute function along with the Filter function, collections etc, but I'm stumped. I would prefer not to create a calculated column in SP and instead have all the logic in the Power App

 

Any help appreciated.

Thanks

Categories:
I have the same question (0)
  • Verified answer
    Adrian_Celis Profile Picture
    1,652 Moderator on at

    Hi @Marty3012 ,

    Does the Request ID always have the prefix "CR"?

    If so, firstly, get the last ref number from your SP List

     

    Set(varLastRequestID,First(Sort(YourSPList,'Request ID',SortOrder.Descending)).'Request ID')

     

    Remove the "CR" and then turn the remaining text into a number, add + 1, then turn it back into text.

     

    "CR" & Value(Substitute(varLastRequestID,"CR",""))+1

     

    Let me know if this works.

     

  • Marty3012 Profile Picture
    on at

    Yes, it works, thanks. Sorry, was working on this over the weekend, hence the delay.

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
WarrenBelz Profile Picture

WarrenBelz 93 Most Valuable Professional

#2
Haque Profile Picture

Haque 81

#3
Valantis Profile Picture

Valantis 49

Last 30 days Overall leaderboard