cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Preetish
Level: Powered On

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

I have a requirement on Microsoft Flow. I have two SharePoint Lists. First List name is "Leave Requests" and another List name is "Leaves".

 

As per my requirement, the "Leaves" list contains the total number of leaves of an employee where an employee will enter a leave request by using the "Leave Requests" list. When the employee will request his/her required number of leaves, then the leave will deduct from the total number of leaves which is present in the "Leaves" list.

 

To subtract the number of leaves of an employee from the total number of leaves, I have used "Compose" action in my Microsoft Flow. In that action, I have typed "sub(int(item()?['TotalLeaves']),int(triggerBody()?['NumberOfDays']))" in the expression. You can see the below screenshot:

flow compose error.png

 

While I am running this Microsoft Flow, It is giving me below error:

flow compose errors.png

 

Can anyone suggest how can I subtract these two request fields?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

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

Hi @Preetish ,

 

I infer that Filter array is used to filter the user who is currently creating the item.

The Expression you are using now seems to work in Apply to each.

Like:78.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 REPLY 1
Community Support Team
Community Support Team

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

Hi @Preetish ,

 

I infer that Filter array is used to filter the user who is currently creating the item.

The Expression you are using now seems to work in Apply to each.

Like:78.PNG

 

Please take a try.

 

Best Regards,

Community Support Team _ Barry
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

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

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

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Users Online
Currently online: 192 members 5,554 guests
Please welcome our newest community members: