Hi there,
I have the following flow:
In short, I pull items from an SP list, filter them for only dates in the future, then will send an email a x days before the listed date, make a table and email that to a particular person. However, it sends me five emails, one for each of the filtered rows coming out of Filter Array.
When I tried to take this out of the Apply to Each I get the following error :
Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'split' expects its first parameter to be of type string. The provided value is of type 'Null'.
I think this refers to the condition, where I've had to convert a string to a date to compare it to utcNow. That looks like:
formatDateTime(parseDateTime(concat(split(item()?['FSAGDate'], '/')[2], '-', split(item()?['FSAGDate'], '/')[1], '-', split(item()?['FSAGDate'], '/')[0])), 'yyyy-MM-dd')
I can only assume the reference to FSAGDate in here (my string that needs to be converted to a date) is somehow not being read properly.
I thought I finally had this working, but now I get 5 emails!
If you are going to create an HTML table then that is a string and you want to append it to a string, not an array. Then you can just add the string to the body of the email and it should process as HTML tables.
If you only want one table then append the data to an array and then create the HTML table from the array after you exit the loop.
Hi @Pstork1
Great! So I've gotten this far:
But can't quire figure out how to use the variable in my email. And if I did, would it still appear as an HTML table?
You need to use a second condition to check whether the string or array contains anything before sending the email. If its blank or empty then don't send the email.
Thanks @Pstork1
I had thought about doing that, putting the email outside of the loop, but my logic tells me that then if the condition equates to false, it would still send an email, but with nothing in it?
Since you are processing 5 rows you need the loop. The trick is to accumulate the information while you are in the loop by appending it to a String or Array and then sending the email with the accumulated information once you exit the loop.
Michael E. Gernaey
566
Super User 2025 Season 1
David_MA
516
Super User 2025 Season 1
stampcoin
492