Hello everyone and welcome to my blog. In today’s blog I will discuss on how to perform substring operations in Canvas apps.
Unlike other platforms, Power Apps does not have the substring function. However very similar to the substring, there is a Mid function which can be used to achieve similar results.
Let’s get started. Below is the nomenclature of the Mid function.
Mid( String, StartingPosition [, NumberOfCharacters ] )
The parameter – NumberOfCharacters is optional.
Let’s start test with one of the most common phrase in the computer world – “The quick brown fox jumps over the lazy dog“.
Let’s say, I want to extract the entire text starting from the word fox. The formula to achieve that would be.
Mid("The quick brown fox jumps over the lazy dog", 17)
Let’s make it a little more complicated. I just want to retrieve the word fox from the whole phrase. In that case, you would need the below formula.
Mid("The quick brown fox jumps over the lazy dog", 17, 3)
Isn’t it very close to what substring does? So now you know what you can use in Power Apps to achieve the same desired results of substring function.
For more intricate string operations, you can follow my blog here where I have demonstrated the usage of Mid, Left and Right functions in Power Apps to achieve complex string manipulation needs.
Hope this helped.
Debajit Dutta
Discover more from Debajit's Power Apps & Dynamics 365 Blog
Subscribe to get the latest posts sent to your email.