Showing results for 
Search instead for 
Did you mean: 
New Member

lastIndexOf doesnt work




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.

Community Support
Community Support

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.

Any news on this, it is still not working!

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.




Responsive Resident
Responsive Resident

Im trying this some 2 years later:


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

Responsive Resident
Responsive Resident

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

Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Power Automate Designer Feedback_carousel.jpg

Help make Flow Design easier

Are you new to designing flows? What is your biggest struggle with Power Automate Designer? Help us make it more user friendly!

Top Solution Authors
Users online (2,331)