Hi all,
I am trying to change the Subject in the email that gets sent out dynamically depending on whether any of their actions have gone overdue.
The email takes a Created HTML table to combine all actions into a singular email so some might be within the due date and others might be overdue, I am trying to flag the email subject to 'URGENT: You have actions overdue!' if one of the actions is overdue.
into the subject line but it doesn't like it.
Any ideas what I could be doing wrong?
Thanks in advance.
Solved! Go to Solution.
Thanks for the reply abm.
In the end I used another filter on the array I had to look for Overdue actions:
Then I just used the array to check if it was empty or not:
Hi @TWolsten
The less() expression returns true or false. The I can see you are checking the length of the boolean value which is going to fail the flow. I would say please split into compose action steps for each and check what you are getting from the run history. This way its easy to debug the values. Also once its all working you can use as a single expression.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThanks for the reply.
It seems to be failing to find the Due field in my Create HTML table:
InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)' inputs at line '0' and column '0': 'The template language expression 'if(less(formatDateTime(body('Create_HTML_table')?['Due'],'yyyy-MM-dd'), formatDateTime(utcNow(),'yyyy-MM-dd'),1), 'URGENT: You have actions overdue!', 'Actions Outstanding')' cannot be evaluated because property 'Due' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.
I thought it could be because it is an array of multiple items within the HTML table but all I am wanting to do is scan through all the items in the array and if one of them is Overdue then change the title of the email, do you think this is possible?
Hi @TWolsten
Need to see your flow and a sample data. Could you post a screenshot and some data?
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blog
In regards to to the data, the only thing I am using in the formula is the 'Due' column which is a date field and I am wanting to pass an If statement to determine if the title of the email should be either:
The rest of the flow (prior to the formula) gathers all individuals who have actions and sends out individual emails to them
In regards to to the data, the only thing I am using in the formula is the 'Due' column which is a date field and I am wanting to pass an If statement to determine if the title of the email should be either:
The rest of the flow (prior to the formula) gathers all individuals who have actions and sends out individual emails to them
Hi @TWolsten
Thanks for the screenshot.
The error you are getting is "cannot be evaluated because property 'Due' cannot be selected. Property selection is not supported on values of type 'String'"
Could you add a compose action step above the email action step and map
body('Create_HTML_table')?['Due']
Check the run history and see what value its returning?
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogFails again:
InvalidTemplate. Unable to process template language expressions in action 'Compose_2' inputs at line '0' and column '0': 'The template language expression 'body('Create_HTML_table')?['Due']' cannot be evaluated because property 'Due' cannot be selected. Property selection is not supported on values of type 'String'.
Hi @TWolsten
Check the run history of Create HTML table. Believe this is an array. You cannot use the property like that.
Thanks
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogCorrect it is an array, so if I wanted to skim through all the values is there a way to do that? Then say if the count of any of the items is greater than or equal to 1 then show one title and if it is less than 1 then show the other?
Any ideas on this please?
Hi @TWolsten
After filter array 2 Add an Apply to Each Loop action step. Add the body('Filter_array_2') under the apply to each to iterate. Inside the loop you can access the properties like this.
item()?['Due']
Thanks
body('')?['Due']
If you liked my response, please consider giving it a thumbs up
Proud to be a Flownaut!
Learn more from my blogThanks for the reply abm.
In the end I used another filter on the array I had to look for Overdue actions:
Then I just used the array to check if it was empty or not:
User | Count |
---|---|
101 | |
36 | |
29 | |
25 | |
16 |
User | Count |
---|---|
133 | |
54 | |
53 | |
36 | |
26 |