I'm trying to search the first character of the last name. If the first letter begins with letters A - L then and email should be sent to one person and if the last name begins with the letter M - Z then an email should be sent to another person.
Here is the expression I'm using
There is a different way to do this by:
1. Creating a 1 character string variable with this as the Value: substring(triggerOutputs()?['body/Title'],0,1)
2. Then use the Condition Control to test the variable. I selected the "is greater than or equal to" and "is less than or equal to" options in the dropdown and also used AND.
This is a pic of the flow:
This worked for me in all my tests. If the input for the variable is not already a string, you would need to convert it to a string in the formula.
Scott
Thats the reason i nested condition action. You can see for K and L which i added in second condition action.
First condition action check for A to J letter if true send email. If false it will go to second condition action where test for J and K will be happened, if yes send same email in yes block. If false No block will work for rest of the letter here send email for letter M to Z.
Try it this will work.
Thanks
Hardesh
Thank for that idea. But I think I need another solution since there is a limit of 10 conditions and I would need at least 12.
Currently i have this kind of idea with Condition action- Use OR with each condition. and Start with in each condition.
In YES block use email action for A to L and in NO use email for M-Z.
Thanks
Hardesh
Thank you.
To clarify, I'm trying to use starstWith to find if the text starts in a range of characters. For example, I want to know if a last name start with the letter between A and L. Is there a way to do something like this ^[A-L] in the StartText option? StartsWith( Text, StartText ).
Thank you
Pls add this "body('Get_response_details')?['r5fe8a238040a4b92a9bdb86b6c621c29']" in compose action and then you can see what is output of your input.
StartsWith function is case sensitive. for more information you can refer-
https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/functions/function-startswith
Thanks
Hardesh
Tomac
986
Moderator
stampcoin
699
Super User 2025 Season 2
Riyaz_riz11
577
Super User 2025 Season 2