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??
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
@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.
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!