Hi,
Let me explain my question in detail:
I have a flow that runs every time I receive an email, and I want to save every email that is inside the From, To and CC fields.
So I made a variable of type object, so I don't need a ton of initialize variable actions.
This variable has a bunch of properties, and one of them will hold that list of emails that I want to save.
For this I made a large formula that sets the property to a union of multiple arrays so all emails are merged inside 1 array.
Problem is that the To and CC field is a string with multiple emails inside with ";" as the separator.
So this is the formula I had to come up with:
setProperty(
variables('Flow Variables'),
'vEmailUsers',
union(
variables('Flow Variables')?['vEmailUsers'],
createArray(triggerOutputs()?['body/from']),
split(triggerOutputs()?['body/toRecipients'],';'),
split(triggerOutputs()?['body/ccRecipients'],';')
)
)
This function works pretty good until i get an email that has an empty cc...
So the error says that the split function can't have null value for the first parameter.
Hence I was thinking to surround it with an if statement so that if it is empty I would return an empty array.
Except I don't know how...
I tried using createArray() without parameters, but that's not possible, and regular brackets won't work either.
So I am wondering how it could be solved?
Any ideas?
Thanks in advance!