Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Getting a number from a URL

(0) ShareShare
ReportReport
Posted on by 375

Hi 

I have a SharePoint Online list and I am able to loop through each row.

One column URL, has values like this ...

 

http://myserver/tikitlink/tikitlink.asp?doc=12345&lib=lib1

 

How can I extract the doc number?

 

I tried to use this ...

uriPathAndQuery(items('For_each')?['URL'])

which gives me 

/tikitlink/tikitlink.asp?doc=12345&lib=lib1

 

but I get stuck there.

 

Thanks

P

 

  • pmwhelan Profile Picture
    375 on at
    Re: Getting a number from a URL

    Thanks!

     

     

     

     
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    on at
    Re: Getting a number from a URL

    Hi @pmwhelan,

    Modify as below:

    first(split(last(split(uriPathAndQuery(items('For_each')?['URL']),'doc=')),'&'))
  • pmwhelan Profile Picture
    375 on at
    Re: Getting a number from a URL

    Like this?

    first(split(split(item()?['URL'], 'doc='), '&'))
    It fails.
    InvalidTemplate. Unable to process template language expressions in action 'Set_variable' inputs at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Array'. Please see https://aka.ms/logicexpressions#split for usage details.'.

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

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 497 Super User 2025 Season 1

#2
David_MA Profile Picture

David_MA 436 Super User 2025 Season 1

#3
Riyaz_riz11 Profile Picture

Riyaz_riz11 244 Super User 2025 Season 1