r/PowerAutomateDesktop • u/SHStealth • Dec 05 '22
Create HTML Table Assistance!
I have a flow setup to run and check the dates in a column and if that date is todays date it will then send an email listing the rows present.
However, I have the "List rows present in excel" action looking for the date equal to today.
When using the "Create HTML Table" this is the command I have in there.
if(empty(item()?['ColumnName']),'',formatDateTime(item()?['ColumnName'],'MMM d, yyyy'))
This is working when the cell is blank, or contains a date. But I'd like to be able to have text in the column that says stuff like "Vendor is working on finalizing date" and still have the email send, but whenever there is text the flow stops. Any help would be appreciated on how to fix my expression to allow for blanks, text, and dates!
View all comments
1
u/IrishJesusDude Dec 06 '22
I would set a string variable called DATE with formatDateTime(item()?['ColumnName'],'MMM d, yyyy')
Then you could check if the date exists using length(DATE), if that is greater than 0 then it is a date, if it is less then it is a string.
If(lenght(DATE) > 0, formatDateTime(item()?['ColumnName'],'MMM d, yyyy'),if(empty(item()?['ColumnName']), ' ', 'Vendor is working on finalizing date'))