When receiving email strings within Logic Apps there may be a scenario in which you’ll need to split the domain away from the full string. Here’s a quick how-to on how to do this!
In my example, I am receiving an email string such as [email protected] in my flow trigger. However, I require to split everything after the @ and pipe this into a variable for later use in my flow.
Connectors & Expression
Using the below expression in a ‘initialize variable’ under the value field as an expression will split anything after the @ in the email string.
last(split(variables('YOUR VARIABLE NAME TO SPLIT'),'@'))
JSONFlow Example
In the flow example below, my trigger is receiving a string input of an email address. Your string input may be from various values (http triggers, JSON parsing, etc), below is just a reference.
Taking your dynamic content from your input into a variable like below (‘Email’). We can then add another variable calling on the email variable with an expression in the value field, using the code from the above expression.


It’s as simple as that!
Latest Posts
Create Azure Monitor Baseline Alerts initiative with Enterprise Policy as Code
Azure Deployment Stacks: Zero to Hero 🦾❤️
Azure Policy: Deny Log Analytics Workspaces creation without Daily Quota