I have a flow for an e-mail inbox, and I want it to record the time at which an e-mail message was first replied to. It's a shared inbox, so we have a policy to always CC or BCC the inbox in the reply so that it effectively e-mails itself when a team member replies. I use this as the trigger, and I have a flow that fills in an Excel table with bits of relevant data on e-mail receipt.
My flow currently does this:
E-mail Recieved > Initilialize Array Variable > List Rows > Populate Array with ConversationID > Check if the Conversation ID is in the list > If yes, check if it's come from the inbox (i.e. e-mailed itself) > If yes, update Column X in Excel table.
So I'm stuck because sometimes there are multiple replies for the e-mail, and presently it always updates and overwrites the data. What I want is the last condition to be 'Update Column X if Column X is empty'. If 'Column X' already has a value, I want it to skip and terminate the Flow.
I tried using an if statement, but the flow says it's not valid syntax:
if(empty(item()?['Column X']),triggerBody()?['DateTimeReceived'],item()?['Column X'])
How can I perform this logic? Any advice would be greatly appreciated.
Not entirely sure if this has been solved before, but I can't find an answer to this so apologies if I have missed it.
Solved! Go to Solution.
Thanks for the help on the expression. I think the next problem is that this is returning a value of 'True' when the cell is not empty, which is not correct. I don't think it's testing the correct cell. Any ideas on how I can make sure it's using the right row?
You might have spaces on certain cells. You could check length expression of that cell to make sure it's returning zero. You may need to use trim as well before using the length.
length(trim('columnname')) > 0
Thanks for getting me on the right track! I had missed a step. Basically, I had forgotten to dump the column into a string variable. now that this is filled, I can do my checks (per your post) and it works.
Read the announcement for more information!
Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
The top training and networking event across the globe for Microsoft Business Applications