cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
New Member

lastIndexOf doesnt work

Reference,

https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#l...

 

 

lastIndexOf('hello world', 'world')

I have been trying this expression, and it returns 6 instead of 10.

 

Can you please have this fixed?

 

To test this, I am simply initializing a variable with this expression, and it doesnt work!

 

Thank you.

5 REPLIES 5
Highlighted
Community Support
Community Support

Re: lastIndexOf doesnt work

Hi @Saikumar,

 

Thanks for your feedback. I can reproduce this issue on my side. It seems that functions indexof and lastindexof return the same value. While lastindexof should return the ending position of a string.

 

I will help report this issue on my side and back to you later.

 

 

Best regards,

Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
Advocate II
Advocate II

Re: lastIndexOf doesnt work

@v-yamao-msft
Any news on this, it is still not working!

Highlighted
New Member

Re: lastIndexOf doesnt work

Hi @Naireb 

 

This is expected. Please see the descrption from the doc link you provided:

"Return the starting position or index value for the last occurrence of a substring."

For example,

lastIndexOf('hello world world', 'world')

Should be 12.

 

@v-yamao-msft  FYI.

 

Thanks,

Vincent

Highlighted
Resolver I
Resolver I

Re: lastIndexOf doesnt work

Im trying this some 2 years later:

lastIndexOf(variables('FullLibraryURL'),'/'')

but this is not working, 'the expression is invalid'  but it seems valid if im not mistaken.

Highlighted
Resolver I
Resolver I

Re: lastIndexOf doesnt work

I noticed i had 1x ' too many in the end.

Helpful resources

Announcements
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!

Top Solution Authors
Users online (6,880)