web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Int function error mes...
Power Automate
Unanswered

Int function error message

(0) ShareShare
ReportReport
Posted on by

I'd like to have anyone's advice regarding 'Int' function error as following.

I got error message;

 

'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type'

 

So I removed 'int' from expression, but another error message coming;

 

'The template language function 'addDays' expects its second parameter to be an integer. The provided value is of type 'String'. Please see https://aka.ms/logicexpressions#adddays for usage details.'

 

What is the cause??

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @Anonymous 

     

    Can you check from the flow run history on what the value is being passed in the integer function? I am guessing it is being returned as a float so you might want to replace int with float. 

     

    If you can share more details and a screenshot, we might be able to assist you better. 

     

    Hope this Helps!

    Hope this Helps!

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • Community Power Platform Member Profile Picture
    on at

    @yashag2255 , thank you for you support.

    InvalidTemplate. The execution of template action 'Select_Array_from_Excel_for_Word' failed: The evaluation of 'query' action 'where' expression '{ "Date": "@formatDateTime(addDays('1899-12-31',int(item()?['11_Date of Study'])),'yyyy-MM-dd')", "Start": "@formatDateTime(item()?['12_Start Time'],'HH:mm')", "Rest": "@formatNumber(int(item()?['13_Rest Hour']),'0.0')", "Finish": "@formatDateTime(item()?['14_Finish Time'],'HH:mm')", "Hour": "@formatNumber(int(item()?['15_Hours']),'0.0')", "Curriculum": "@item()?['21_Curriculum']", "Dept": "@item()?['22_Tutor Dept JP']", "Trainer": "@item()?['23_Tutor Name JP']", "Impression": "@item()?['31_Impression']", "Completion": "@item()?['32_Completion']" }' failed: 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.

    This is all error message what I got.

    formatDateTime(addDays('1899-12-31',int(item()?['11_Date of Study'])),'yyyy-MM-dd')

    This is my expression.

     

    Previously it was working well, but got error once change the data source excel file,,, but the file was generated from the same system with same process, so basically it should be the same contents. 

  • Michael Shen Profile Picture
    on at

     you need check the exact data in that run history, it looks like 

    item()?['11_Date of Study']

    returned the data that can't be converted into int 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard