Hows it going ? Lockdown ? Yep me too. Bored ? Just a little bit.
I get these urges to write blog posts at the weirdest times. I woke up at 4:55am to the night time terror screams of my 4 year old and first thing I thought of, well after wondering what on Earth the racket was, was split and empty functions in power automate.
Yeah. I’m obsessed I know.
Do the SPLITS
Split is proper handy it lets you take a string and split it in two at a character of your choosing. I needed to pull a company name out of an email address so I pass the string through the split function and tell it where to split the text and hey presto !!
Lets look at this in more detail.
The string value is
We would like to get the “company” part out of this string. So watch split do it’s magic
It’s syntax is
Split( Text, Separator )
Split will return a string for each piece of text before and after the separator and output it as an array.
is going to give us an array of two items
We need the second part of this array so the above expression becomes
In this example the top string is  and the second part with company is . This is it's index inside the array.
This will now give us the result
Next we need to pass that through a second split function to get the ‘company’ part of the string
which in a flow might look something like this
So we then add the index at the end  to get ‘company‘
Wahoo. Broken down it looks like this:
The example is broken down into 3 compose steps.
First split - selects “company.com”
Second split - selects “company” from the array.
You can just jump to the "Compose: Do the SPLITS" action to do the whole thing in one compose step.
Now for Empty
What I needed to do here was take a form response and in one particular field, base a condition on whether there was any text entered or not.
All you need to do is wrap the string or forms dynamic field in empty() and it will respond with either a true or false.
In the condition step you say
True does not equal empty(form response)
That way, if the form field is empty it will return false. As true does not equal false the condition is satisfied and you are taken down the Yes path of the condition.
Thanks, have a good weekend, I'll try and get a lie in tomorrow!