cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft
Microsoft

Compose and Send a Table of SharePoint Information

Hello All, 

 

I am building a flow that will send an email alert to the task owner of an item in SharePoint if the due date is overdue.

 

My issue is putting this information into the body of an email. I hoping to use the create CSV action but, I keep running into an error.  

 

I am creating variables in order to bypass the apply to each function that I can't seem to remove on its own, so this is the solution I found. 

Now my issue is putting those variables into a table and sending an email with the populated data. 

The error I am receiving is the following:

 

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The inputs of template action 'Send_an_email_(V2)' at line '1 and column '3372' is invalid. Action 'Apply_to_each' must be a parent 'foreach' scope of action 'Send_an_email_(V2)' to be referenced by 'repeatItems' or 'items' functions.'.'.

 

Any and all help will be much appreciated.

flowpart1.PNGflow22.PNG

 

Thank you,

Jules 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Hi @caruso1058,

 

There is no need to create three variables to hold these data, CSV table could loop through the input, convert an array into a CSV table dynamically. The value field could append the properties of the input array, item() function could extract current item and ?['PropertyName'] could extract property value:

https://docs.microsoft.com/en-us/power-automate/data-operations#use-the-create-csv-table-actionAnnotation 2020-05-28 142431.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
Highlighted
Community Support
Community Support

Hi @caruso1058,

 

There is no need to create three variables to hold these data, CSV table could loop through the input, convert an array into a CSV table dynamically. The value field could append the properties of the input array, item() function could extract current item and ?['PropertyName'] could extract property value:

https://docs.microsoft.com/en-us/power-automate/data-operations#use-the-create-csv-table-actionAnnotation 2020-05-28 142431.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

Hello @v-litu-msft , 

 

Thank you very much for your reply. That was very helpful and I am now moving in the right direction.

 

However, I have two subsequent issues:

First, the CSV output is not a pleasant output to digest. Is there a Flow action that converts the CSV output into a tabular format that can then be inserted into the body of the auto generated email?

 

Second (most important issue), a column that I am calling is not being picked up in the CSV output. I have a column called Task in my SharePoint Library as shown in the snip below. 

 

Unfortunately for me, this is a vital column that I am attempting to build this flow around.
One criteria that the flow needs to meet is that the Task is 'Yes'

 

I have attempted to filter this in a number of different ways, however, all of my attempts have failed:

When I attempted to filter this within the Get Files action the Flow fails due to the column not being recognized (see snip).

When I attempt to filter this through the Filter Array action (see code used below), it seems to overlook the Task part of the argument.

@and(equals(item()?['Task'], 'Yes'),and(lessOrEquals(formatDateTime(item()?['Issue_x0020_Date'], 'yyyy-MM-dd'), formatDateTime(utcNow(), 'yyyy-MM-dd'))))

 

Lastly, when I call out the value in the CSV file, the output for this value is blank even though all other fields are returning values (but the returned values is a much longer list because it is not filtering down to only the Yes Task items).task not rendered.PNGtask column.PNGflow23232.PNG

Any and all help is much appreciated.

Thank you! 

Highlighted

Hi @caruso1058,

 

1. Create HTML table could convert the array into HTML table that could insert into Email body.

Annotation 2020-05-29 172727.jpg

2. You could check the column system name in the output of Get files action, I assume you modified the Task column name in the past, the column system name has been initialized and not changeable. If you use the task to extract it will report the error.

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Highlighted

Hello @v-litu-msft

 

 Thanks for the suggestion, I think I will try and transform the output into an HTML Table.

 

As for the Task Value, I was able to figure out the name of the Column by hovering the column name. For some reason Flow is recognizing this column as Template/Value.  I'm not sure why Flow has renamed this column, but now that I know the column name I was able to filter down the list to the correct values. 

Capture.PNG

 

Thanks for your help!

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

Top Solution Authors
Top Kudoed Authors
Users online (10,543)