Hello,
In this short article I will provide clear instruction how to take for example second from the end word from sentence “I am Rafal Kobus” in Power Automate. Let’s say that we have our dynamic value in outputs(‘Compose’). Firstly we have to split phrase by spaces or other sign to have an array.
split(outputs('Compose'), ' ')
Then we are building as an example another Compose step where will have result.
first(skip(split(outputs('Compose'), ' '),sub(length(split(outputs('Compose'), ' ')),2)))
That function will give us Rafal from sample string. To adjust that to your requirements, parameter representing words from the end is the number at the end of function (here 2).
General look of the function:
first(skip(split(<your string>, <your delimiter>),sub(length(split(<your string>, <your delimiter>)),<selection parameter as number>)))
Leave a comment