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
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

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.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (2,923)