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.

View solution in original post

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.

View solution in original post

Helpful resources

Announcements
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!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

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 Power Automate Community Video Gallery!

Top Kudoed Authors (Last 30 Days)
Users online (4,938)