cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Preetish
Regular Visitor

'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
v-bacao-msft
Community Support
Community Support

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
v-bacao-msft
Community Support
Community Support

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

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (1,580)