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 Automate / How to substr value an...
Power Automate
Answered

How to substr value and add next number

(0) ShareShare
ReportReport
Posted on by

I have such an initialized variable

Palucci12_0-1684439995074.png

I would like to, after fulfilling some condition, cut off 001 and add another number, i.e. 002, after releasing another flow, so that Revision003 would be created and so on.I wanted to add something like this in Compose, but it shows me that exxpresion is not valid. Where am I doing wrong?

concat('Revision', int(substring(variables('Revision'), 8, 3)) + 1)
Categories:
I have the same question (0)
  • Verified answer
    Rhiassuring Profile Picture
    8,692 Moderator on at

    Hi there, 

     

    Try this instead:

     

    concat('Revision',concat(substring('000',1,sub(3,length(string(add(int(substring(variables('Revision'),8,3)),1))))),string(add(int(substring(variables('Revision'),8,3)),1))))

     

     

    To break this down and make it a bit easier to read, you could instead try adding another variable, "NewRevision", with this formula: 

     

    string(add(int(substring(variables('Revision'),8,3)),1))

     

    And then your compose would be:

     

    concat('Revision',concat(substring('000',1,sub(3,length(variables('NewRevision')))),variables('NewRevision')))

     

    A wee bit cleaner, but, always fun to try and get it into one line 🙂 

     

    Cheers,

     

    R

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

These are the community rock stars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 274 Super User 2026 Season 1

#2
11manish Profile Picture

11manish 175

#3
Haque Profile Picture

Haque 166

Last 30 days Overall leaderboard