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

Deleting part of a string

Hello,

 

I was wondering if anyone could help me with this problem. I have a string coming from powerapps that is a string of numbers (EX: 1,2,3,4,). I have figured out how to seperate the numbers using the split() function; however, it is adding an extra item for the last comma. So for the example given above, it would give back "1", "2", "3", "4", " ". I was wondering if anyone knows how to get rid of the last item using flow?

 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Frequent Visitor

Re: Deleting part of a string

Hi 

 

This should do the trick

 

if(endsWith(variables('stringToSplit'),','),subString(variables('stringToSplit'),0,lastIndexOf(variables('stringToSplit'),',')),variables('stringToSplit'))

 

ApplicationFrameHost_2017-09-09_18-25-29.pngApplicationFrameHost_2017-09-09_18-29-03.png

View solution in original post

1 REPLY 1
Highlighted
Frequent Visitor

Re: Deleting part of a string

Hi 

 

This should do the trick

 

if(endsWith(variables('stringToSplit'),','),subString(variables('stringToSplit'),0,lastIndexOf(variables('stringToSplit'),',')),variables('stringToSplit'))

 

ApplicationFrameHost_2017-09-09_18-25-29.pngApplicationFrameHost_2017-09-09_18-29-03.png

View solution in original post

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Upcoming Events

Experience what’s next for Power Automate

See the latest Power Automate innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (5,990)