Get the starting position of the last match of the specified text (right-most matching text).
|text||Required field||Target text.|
|searchText||Required field||Text to be searched.|
How to use
In actions it is often used in "Condition".
It is also used to initialize or set variables of type Integer.
Clicking on lastIndexOf in the "Expression" tab sets the function name and () in the formula field.
Specify text enclosed in "'" and delimited by "," and click OK.
If you want to use dynamic content or variables, the ,delimiter is the same.
If you see something like the following, your settings are complete.
You can change the contents of the function by clicking on the purple icon.
If you use "lastIndexOf('abcdefabc','abc')" as in the example,
The result is 6, which is the start of the second "abc".
In the case of the similar function indexOf, the leftmost result is 0.
The result is the same for "lastIndexOf('abcdefAbc','aBc')" as it is case-insensitive.
If not found, the result is -1.
Example of use.
When a file is created Trigger in OneDrive For Business Connector.(Power Automate Cloud flows)
Used for editing dynamic content.