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

Creation of Flow that sends email based on an excel

Hey guys, thank you for your time,

 

I need some help with a flow.

 

I have an excel with a column that has return dates of equipment and another column with emails

 

I want a flow that checks if the date at the return dates column is today and if it is correct to send an email from the same row using the email address.

 

Flow Temporary assets Reminder.png

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Creation of Flow that sends email based on an excel

Hi @DarkLord22,

 

Do you want to find a particular row or all rows? If all rows, you can use the List all rows in a table action instead of Get a row action.

 

 

Is the Dates of equipment column a Date format? If it is, it will return a number of days start at 1899-12-30, so, after you extract from excel, you need to process the date by using addDays function:

addDays('1899-12-30',int(item()?['Dates of equipment']))

After that, compare it with today, and the utcNow() also need to process:

formatDateTime(utcNow(),'yyyy-MM-dd')

Annotation 2019-10-24 095216.png

Please have a try, I hope it can help you.

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

10 REPLIES 10
Highlighted
Community Support
Community Support

Re: Creation of Flow that sends email based on an excel

Hi @DarkLord22,

 

Do you want to find a particular row or all rows? If all rows, you can use the List all rows in a table action instead of Get a row action.

 

 

Is the Dates of equipment column a Date format? If it is, it will return a number of days start at 1899-12-30, so, after you extract from excel, you need to process the date by using addDays function:

addDays('1899-12-30',int(item()?['Dates of equipment']))

After that, compare it with today, and the utcNow() also need to process:

formatDateTime(utcNow(),'yyyy-MM-dd')

Annotation 2019-10-24 095216.png

Please have a try, I hope it can help you.

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
Helper III
Helper III

Re: Creation of Flow that sends email based on an excel

I cannot understand why we do the add days function, I get the bellow error when I test the flow:

"InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2798': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'."

 

Shall I put a specific date at the begin of the function? (1899-12-30)

addDays('1899-12-30',int(item()?['Dates of equipment']))

 

About the questions, you ask at the begin:

The row is date format and the column name is "Return Date" also the format is dd-MM-yyyy

Highlighted
Community Support
Community Support

Re: Creation of Flow that sends email based on an excel

Hi @DarkLord22,

 

If you appear the InvalidTemplate error, you may not have the correct connection, please create a new connection.

 

Yes, it should be inputted on a specific date at the begin of the function. (1899-12-30)

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
Helper III
Helper III

Re: Creation of Flow that sends email based on an excel

Thank you for the support i tried a million things but it never worked.

 

Keep in mind that i changed the structure since with the excel it did not work correctly from the begin.

 

Just to specify the details i use a sharepoint list and I want the "Row Date_Issued" + 7 days to be checked if it is less or equal to today.

Capture.PNG

 

Capture2.PNG

 

I tried many different options but none is working

 

addDays('1899-12-30',int(item()?['Date_Issued']))
addDays(utcNow(),int(item()?['Date_Issued']))
addDays(utcNow(),int(triggerBody()?['Date_Issued']),'yyyy-MM-dd')
 

I get the bellow error

"InvalidTemplate. Unable to process template language expressions in action 'Compose' inputs at line '1' and column '2806': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'."

Highlighted
Community Support
Community Support

Re: Creation of Flow that sends email based on an excel

Hi @DarkLord22,

 

If you are using SharePoint list, it is not necessary to convert the date format, please use the following expression:

 

addDays(item()?['Date_Issued'],7)

Annotation 2019-10-25 163414.png

 

 

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
Helper III
Helper III

Re: Creation of Flow that sends email based on an excel

I get the bellow error:

 

InvalidTemplate. Unable to process template language expressions for action 'Condition' at line '1' and column '2806': 'The template language function 'addDays' expects its first parameter to be a string that contains the time. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#adddays for usage details.'.

 

Thanks

Highlighted
Community Support
Community Support

Re: Creation of Flow that sends email based on an excel

Hi @DarkLord22,

 

Please create this button when you test to create the connection of SharePoint connector.Annotation 2019-10-25 172026.png

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
Helper III
Helper III

Re: Creation of Flow that sends email based on an excel

Still receive error but its not the same now:

 

InvalidTemplate. Unable to process template language expressions in action 'Send_an_email_(V2)_2' inputs at line '1' and column '2809': 'In function 'addDays', the value provided for date time string 'Date_Issued' was not valid. The datetime string must match ISO 8601 format.'.

 

Any ideas?

Highlighted
Helper III
Helper III

Re: Creation of Flow that sends email based on an excel

How i can add days to the bellow expression?

 

formatDateTime(outputs('Compose'), 'MM-dd')
 
I want to add 7 days.
 
Thanks!
Highlighted
Community Support
Community Support

Re: Creation of Flow that sends email based on an excel

Hi @DarkLord22,

 

Before you formate date, you need to addDays firstly, for example:

formatDateTime(addDays(outputs('Compose'),7), 'MM-dd')

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.

Helpful resources

Announcements
firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

Top Solution Authors
Users online (6,127)