cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
M_Asnawi
Frequent Visitor

Unable to Process Template Language for Date String/Integer Issue

Hi Flow experts and community, I am planning to Flow update the data from Excel to Sharepoint List, but I am having trouble with

the Next Due Date column (integer/string issue). After spending some times in the forum, I finally found this expression: if(empty(item()['Next Due Date']),null,addDays('1899-12-30',int(item()['Next Due Date']),'yyyy-MM-dd'))


Excel date.png

 

 

                                 SP Dates.png

 

However, now I encountered this error:

 

Flow Error.PNG

 

Can you guide me on the way forward for this as this is my first Flow?

 

is it because in Sharepoint, the format is DD/MM/YYYY, while Excel format is MM/DD/YYYY? I have more than 1000 items.

 

Or is there any other better way to solve the string/integer date issue?

 

I attached the screenshot of my Flow as reference.

 

Picture3.pngPicture4.pngPicture5.png

 

 

Picture6.png

 

Thank you.

Regards,

Nawi

1 ACCEPTED SOLUTION

Accepted Solutions
v-alzhan-msft
Community Support
Community Support

Hi @M_Asnawi ,

 

The expression in the Compose 2 should as below:

formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['Next Due Date']),-2)), 'yyyy-MM-dd')

 

Best regards,
Alice       
 
Community Support Team _ Alice Zhang
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

5 REPLIES 5
v-alzhan-msft
Community Support
Community Support

Hi @M_Asnawi ,

 

The expression in the Compose 2 should as below:

formatDateTime(addDays('1900-01-01', add(int(items('Apply_to_each')?['Next Due Date']),-2)), 'yyyy-MM-dd')

 

Best regards,
Alice       
 
Community Support Team _ Alice Zhang
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

Hi @v-alzhan-msft 

 

I've tried the suggested solution, however the error is still the same.

 

New 2.PNG

 

I attached the used expression.

 

Capture New.PNG

 

Is there any other way for this? Or would you require me to provide more details on this?

 

Thank you.

Regards,

Nawi

 

Hi @M_Asnawi ,

 

Please make sure the Next Due Date column for all the rows in your excel table would be valid date time then your issue would be solved, the column value couldn't be null.

 

Or you could add a Condition to check if the Next Due Date is equal to null as my screenshot below:

1.png

 

The expression in the Condition 2:

empty(outputs('Compose_2'))

 

The expression in the Compose 3:

formatDateTime(addDays('1900-01-01', add(int(outputs('Compose_2')),-2)), 'yyyy-MM-dd')

 

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

 

Hi @M_Asnawi ,

 

Please take a try and let me know if your problem has been solved.

 

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

 

Hi @v-alzhan-msft ,

 

I've tried it already, but my problem was still not solved. 

 

Then, I changed the Excel date format to YYYY-MM-DD, suddenly it works. I guess this will be a good sharing to whoever going to read this in the future.

 

Capture.PNG

 

However, under normal condition, your expression works. I consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Users online (2,395)