cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
YAYA
Helper I
Helper I

increase/Decrease quantity Value

Hi, I have two lists, one for Software license and other one for User assigned IT  assets.

the software license list includes two columns, one for software name and other one is number of license.

the User assigned IT assets list has checkboxes columns for each software to check if the user has this software in his PC or not.

what I need in PowerApps is if I checked the software. the  number of license decrease one in software license list. as well as if unchecked the software the number of license increase one.

 

I am not sure if this is the best approach or if there is a better solution to do so.

 

Thanks.

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @YAYA :

I've made a test for your reference:

1\I assume there are two lists:

vbofengmsft_0-1634709630924.png

vbofengmsft_1-1634709639640.png

2\Add a gallery into the canvas app and set it's items property to:

'User assigned IT assets'

3\Add a checkbox(Checkbox1) into the gallery and set it's

Default

ThisItem.software1

OnCheck

With({TargetItem:LookUp('software license','software name'="Software1")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'+1}))

OnUncheck

With({TargetItem:LookUp('software license','software name'="Software1")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'-1}))

Text

"software1"

4\Add a checkbox(Checkbox2) into the gallery and set it's

Default

 

ThisItem.software2

 

OnCheck

 

With({TargetItem:LookUp('software license','software name'="Software2")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'+1}))

 

OnUncheck

 

With({TargetItem:LookUp('software license','software name'="Software2")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'-1}))

 

Text

 

"software2"

 

5\Add a checkbox(Checkbox3) into the gallery and set it's

Default

 

ThisItem.software3

 

OnCheck

 

With({TargetItem:LookUp('software license','software name'="Software3")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'+1}))

 

OnUncheck

 

With({TargetItem:LookUp('software license','software name'="Software3")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'-1}))

 

Text

 

"software3"

vbofengmsft_2-1634709886117.png

 

vbofengmsft_4-1634709911158.png

 

Best Regards,

Bof

 

 

 

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @YAYA :

I've made a test for your reference:

1\I assume there are two lists:

vbofengmsft_0-1634709630924.png

vbofengmsft_1-1634709639640.png

2\Add a gallery into the canvas app and set it's items property to:

'User assigned IT assets'

3\Add a checkbox(Checkbox1) into the gallery and set it's

Default

ThisItem.software1

OnCheck

With({TargetItem:LookUp('software license','software name'="Software1")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'+1}))

OnUncheck

With({TargetItem:LookUp('software license','software name'="Software1")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'-1}))

Text

"software1"

4\Add a checkbox(Checkbox2) into the gallery and set it's

Default

 

ThisItem.software2

 

OnCheck

 

With({TargetItem:LookUp('software license','software name'="Software2")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'+1}))

 

OnUncheck

 

With({TargetItem:LookUp('software license','software name'="Software2")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'-1}))

 

Text

 

"software2"

 

5\Add a checkbox(Checkbox3) into the gallery and set it's

Default

 

ThisItem.software3

 

OnCheck

 

With({TargetItem:LookUp('software license','software name'="Software3")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'+1}))

 

OnUncheck

 

With({TargetItem:LookUp('software license','software name'="Software3")},Patch('software license',TargetItem,{'number of license':TargetItem.'number of license'-1}))

 

Text

 

"software3"

vbofengmsft_2-1634709886117.png

 

vbofengmsft_4-1634709911158.png

 

Best Regards,

Bof

 

 

 

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

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.

Users online (3,148)