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.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,555)