cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
jster24
Frequent Visitor

Split string using (question mark) ? as the separator, then use everything to the left of ?

Hello! 

 

I'm trying to split a string starting from the "?" and take everything from the left of the "?". So far, I'm failing at this...!

 

This would be an example of the string:

/sites/06-000600/06-000621_QOT.xlsx?d=w0b85deee74804b82b1375724a792fc9d

And I want to use this part of it in my next step:

/sites/06-000600/06-000621_QOT.xlsx

 

Right now I am using the "compose" action, I've tried: split('Current_Link_to_File_Name','?'), then also tried to input it as: split("Current_Link_to_File_Name","?") but it reverts back to the single quotations. On trying to run this as a test, I get the error that it cannot contain any control characters. 

Is there a way to use ? as the split separator? And if I can use that, how would I then use everything to the left of the "?" ?
 

Thanks for the help!

 

Jennie

1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Split string using (question mark) ? as the separator, then use everything to the left of ?

Hey @jster24 

 

I just tried this using the first and split functions and am able to achieve the desired output: 

trms.PNG

 Expression: 

first(split(outputs('Compose'),'?'))

 

temss.PNG

 

You need to appropriately reference the input string attribute for this to work. In mine have the Outputs('Compose') to refer to the output from the previous compose action. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

2 REPLIES 2
Dual Super User
Dual Super User

Re: Split string using (question mark) ? as the separator, then use everything to the left of ?

Hey @jster24 

 

I just tried this using the first and split functions and am able to achieve the desired output: 

trms.PNG

 Expression: 

first(split(outputs('Compose'),'?'))

 

temss.PNG

 

You need to appropriately reference the input string attribute for this to work. In mine have the Outputs('Compose') to refer to the output from the previous compose action. 

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

jster24
Frequent Visitor

Re: Split string using (question mark) ? as the separator, then use everything to the left of ?

Thank you, @yashag2255!

 

This was the solution, as well as making sure Flow wasn't adding syntax errors with extra parenthesis as I was adjusting the expression. 

Helpful resources

Announcements
firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (8,150)