Hello!
I can't seem to wrap my head around this, I feel like I'm ignoring something but I can't figure out what exactly.
I have a flow that creates an HTML table based on certain fields in an Excel file. I'm having issues with the format of the dates when there are blanks. I'm using an IF statement that leaves the field as null if the value is null, if it's not then format the date but always returns an error if there's a blank.
Please note that I'm using ISO 8601 as the DateTime format.
Data:
Create HTML Table step:
Formula (I have tried several options, however none of them work):
1.
if(empty(formatDateTime(parsedatetime(item()?['RESP_LAST_USED'], 'en-US'),'MM/dd/yyyy')), null, formatDateTime(parsedatetime(item()?['RESP_LAST_USED'], 'en-US'),'MM/dd/yyyy'))
2.
if(equals(formatDateTime(parsedatetime(item()?['RESP_LAST_USED'], 'en-US'),'MM/dd/yyyy'), ''), null, formatDateTime(parsedatetime(item()?['RESP_LAST_USED'], 'en-US'),'MM/dd/yyyy'))
This is the error that I get when the data has a blank:
The Input shows as ''
Thank you so much for your time, I would highly appreciate it if someone has any ideas on how to fix this.
Solved! Go to Solution.
The problem is the parsedatetime function in the condition part, for the comparisson you should test against the original value like this:
if(equals(item()?['RESP_LAST_USED'], 'en-US', ''), null, formatDateTime(parsedatetime(item()?['RESP_LAST_USED'], 'en-US'),'MM/dd/yyyy'))
The problem is the parsedatetime function in the condition part, for the comparisson you should test against the original value like this:
if(equals(item()?['RESP_LAST_USED'], 'en-US', ''), null, formatDateTime(parsedatetime(item()?['RESP_LAST_USED'], 'en-US'),'MM/dd/yyyy'))
@shoog Thank you so much!! Rookie mistake lol.
I had to change the formula to this in order to make it work!
User | Count |
---|---|
92 | |
45 | |
20 | |
19 | |
15 |
User | Count |
---|---|
136 | |
54 | |
43 | |
42 | |
31 |