cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Tobias410
Frequent Visitor

Gallery Item + 1

Hey everyone,

 

im quite new to Power Apps and currently facing a Problem. Im trying to implement a button which should increase the value of the selected Item by 1.

 

My OnSelect Formular looks like this:

Tobias410_0-1622641503858.png

Error Message: Invaild Argument, expecting Boolean, Number, Text..

I didn't build the formular myself, i found it somewhere and tried to adapt it, but couldn't get it working. I tried to add ".value" and "ThisItem." together with the column name, but it only resulted in different errors.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-qiaqi-msft
Community Support
Community Support

Hi @Tobias410

Could you please tell me that:

  1. what is your data source, SP list or Excel, and does this button exist in the Gallery?
  2. how you set the Text property of the Label  corresponding to the 'Heute zugewiesene Leades'?

I agree with @zmansuri, here is something addition here to explain.

I have a test on my side, please check for reference.

Select(Parent);;
Patch(ListName;ThisItem;{'Heute zugewiesene Leades':ThisItem.'Heute zugewiesene Leades'+1})

Note that you should use a ";;" operator to combine the Select() with the Patch() rather than the "And".

The And operator is used to connect two conditions and manipulate the results of comparisons and tests so that you could not use it to combine two dependent functions.

Hope it could help you.

Regards,

Qi

 

 

 

 

Best Regards,
Qi

View solution in original post

6 REPLIES 6
zmansuri
Super User
Super User

Select(Parent);
Patch(ListName,ThisItem,{Number:ThisItem.Number+1})

trjackson77
Helper II
Helper II

Try this:

Set(varLeads, Value(ThisItem.<<YourField>>) + 1);

Patch(<<YourTable>>, ThisItem, {<<YourField>>: varLeads})

v-qiaqi-msft
Community Support
Community Support

Hi @Tobias410

Could you please tell me that:

  1. what is your data source, SP list or Excel, and does this button exist in the Gallery?
  2. how you set the Text property of the Label  corresponding to the 'Heute zugewiesene Leades'?

I agree with @zmansuri, here is something addition here to explain.

I have a test on my side, please check for reference.

Select(Parent);;
Patch(ListName;ThisItem;{'Heute zugewiesene Leades':ThisItem.'Heute zugewiesene Leades'+1})

Note that you should use a ";;" operator to combine the Select() with the Patch() rather than the "And".

The And operator is used to connect two conditions and manipulate the results of comparisons and tests so that you could not use it to combine two dependent functions.

Hope it could help you.

Regards,

Qi

 

 

 

 

Best Regards,
Qi

View solution in original post

Tobias410
Frequent Visitor

Sorry for my late response. Thx for all your help ! @zmansuri your version worked, but only when i replaced my 'And' with ;; thanks to @v-qiaqi-msft 

Checkout my code: 

I wrote ; at the end.

You just need 1 ;

Glad it worked out for you. Click Accept as solution if i have solved your problem. So, others can find it in future.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

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 (2,505)