How to compare with @ character on a condition action in Power Automate

This is one of the easiest blogs I may have written on Power Automate. And honestly I thought twice before even posting this blog. But then I verified this with couple of citizen developers in the project and both of them struggled doing this for sometime before eventually doing it successfully.

While this is walk in the park for pro-developers, it may not be easy for someone tasting Power Automate in the early stages.

So what’s the requirement here? A very simple requirement. I have a sample string say for example – “Deba@jit

All I need to check if the sample string contains @ character. You may be wondering. Can’t I used the condition action to do this. Well you can. So let’s see the common mistakes we will make here. In this blog, I am only dealing with @ character but basically this shall work for all other special character comparison in Power Automate.

At first we try to check directly with the @ character.

Compare with @ in Power Automate

But the moment you save the flow, because @ is a special character inside Power Automate, it escapes it with additional @ characters.

Compare with @ in Power Automate

And trust me it keeps on adding additional @ characters as you save. Kind of get’s messy. It does not work. So let’s try something else.

In this we enclose the @ character inside quotes like the below example.

Compare with @ in Power Automate

While no problem saving this time but when I run the flow, this evaluate to false. Doesn’t work as well.

So how should I do it? Well, you can use the compose action to take the @ character for comparison. And then use the Output of the Compose action in our check condition.

Compare with @ in Power Automate

And now when I run, the condition evaluate to true.

Compare with @ in Power Automate

Hope this helped! A very simple yet a time saver for someone taking their baby steps in the world of Power Automate.

You will also like the below posts.

Debajit Dutta
Business Solutions MVP


Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe to get the latest posts sent to your email.

Discover more from Debajit's Power Apps & Dynamics 365 Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading