cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
denisbalakirev
Level: Powered On

Buttons stop working properly

HI all,

 

I have 2 buttons in my application to change the value in the Sharepoint list column. They worked well until today. I don’t know why, because I didn’t make any changes to the application, but starting today, the buttons trigger changes of values in the entire table, not in the current cell.

 

Formula is = UpdateIf('Cartriges Storage',Subtitle1.Text=DataCardValue2.Text,{Quanttity:DataCardValue2+1})

 

Any ideas ?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Buttons stop working properly

@denisbalakirev 

So, in your first response formula - you did not seem to use the formula that I gave you.  From what you supplied in the response, you are again Updating everything with that statement.

You HAVE to tell UpdateIf what you want it to update.  You need a condition there that will allow UpdateIf to find the exact record (or records) that you want in order for it to apply your update.

 

As for the ID (again you need to adjust for your app).  I see you are on a Detail screen.  So what got you there?  Was it from a Gallery?  It looks like in your picture you are coming from another screen that has a BrowseGallery1_2 on it.  If that is the case, then you can easily adjust your formula as follows:

UpdateIf('Cartriges Storage',  ID=BrowseGallery1_2.Selected.ID, {Quantity: DataCardValue2+1})

 

This will use the ID of the selected record (the one you are showing in your Detail screen) as the Condition that the UpdateIf function will use to update.

 

Keep in mind with UpdateIf - when you use that function, you are Updating EVERYTHING that matches your condition.  If you ONLY want to update one record, then you need to supply a Condition that will ONLY match one record.  With the above formula, you will be updating ONLY the record that has the same ID as your Gallery selected item...which will be unique and only one.

 

Hope this clears it up for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

7 REPLIES 7
NigelP
Level 8

Re: Buttons stop working properly

Hi @denisbalakirev 

 

go to web.powerapps.com

 

find your app, go to vesions and has there been a new version of PowerApps been deployed overnight ?

 

Otherwise try switching off improved rendering in file => aps settings

 

Regards

 

Nigel

denisbalakirev
Level: Powered On

Re: Buttons stop working properly

@NigelP 

 

I tried your solution but it didn't help. Also, i tried to restore app from backup maked few days ago, result is the same.

Super User
Super User

Re: Buttons stop working properly

@denisbalakirevPlease review your formula...That is where yur problem is.

 

You currently have:
   UpdateIf('Cartriges Storage',Subtitle1.Text=DataCardValue2.Text,{Quanttity:DataCardValue2+1})

 

You are not actually comparing a value in your source to make an UpdateIF.

In other words, your second parameter is the value that will be used to determine if a record should be updated.  In this case, you are comparing a control's Text with another control's Text.  So, if those controls have the same text, it will equate to "True" and thus, your UpdateIf will just Update all records that equate to True...all of them!

 

What you really want to do is to check against a record field to determine IF it should be updated.

So, perhaps:

   UpdateIf('Cartriges Storage',yourField=DataCardValue2.Text,{Quanttity:DataCardValue2+1})

 

Or...a better choice would be to compare using an ID rather than Text (as that can sometimes get you in trouble unless you are forcing unique values for that field).

   UpdateIf('Cartriges Storage',  ID=ThisItem.ID, {Quanttity:DataCardValue2+1})

 

Of course, you will need to adjust the above formulas to your app.

 

Hope this helps some.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
denisbalakirev
Level: Powered On

Re: Buttons stop working properly

@RandyHayes 

 

UpdateIf('Cartriges Storage',yourField=DataCardValue2.Text,{Quanttity: DataCardValue2+1}) 

Give me the same result ;(  UpdateIf('Cartriges Storage',Quantity=DataCardValue2.Text,

 

UpdateIf('Cartriges Storage',  ID=ThisItem.ID, {Quanttity: DataCardValue2+1})

Sorry, but i can't find where i can get id. 

Super User
Super User

Re: Buttons stop working properly

@denisbalakirev 

So, in your first response formula - you did not seem to use the formula that I gave you.  From what you supplied in the response, you are again Updating everything with that statement.

You HAVE to tell UpdateIf what you want it to update.  You need a condition there that will allow UpdateIf to find the exact record (or records) that you want in order for it to apply your update.

 

As for the ID (again you need to adjust for your app).  I see you are on a Detail screen.  So what got you there?  Was it from a Gallery?  It looks like in your picture you are coming from another screen that has a BrowseGallery1_2 on it.  If that is the case, then you can easily adjust your formula as follows:

UpdateIf('Cartriges Storage',  ID=BrowseGallery1_2.Selected.ID, {Quantity: DataCardValue2+1})

 

This will use the ID of the selected record (the one you are showing in your Detail screen) as the Condition that the UpdateIf function will use to update.

 

Keep in mind with UpdateIf - when you use that function, you are Updating EVERYTHING that matches your condition.  If you ONLY want to update one record, then you need to supply a Condition that will ONLY match one record.  With the above formula, you will be updating ONLY the record that has the same ID as your Gallery selected item...which will be unique and only one.

 

Hope this clears it up for you.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

View solution in original post

denisbalakirev
Level: Powered On

Re: Buttons stop working properly

@RandyHayes 

 

Thanks for your time and help, your post helped me a lot! Now it works!

UpdateIf('Cartriges Storage',ID=BrowseGallery1.Selected.ID,{Quantity:DataCardValue2.Text+1})

One more time - Many Thanks!

 

Also, 1 more little question. Maybe you know how to use buttons for filter galler ? Beliave me or not, before my buttons stop works i use:

Items=Filter('Cartriges Storage',Location.Value="MOW01") : For gallrey filtering.

 

But now I need a button for this action, and the old formula does not work for the button.

Super User
Super User

Re: Buttons stop working properly

@denisbalakirev 

You might want to take look at this posting that we discussed a very similar solution to what you might be looking for on the buttons for filters.

Take a look and if that doesn't get you started...post back.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 351 members 5,803 guests
Please welcome our newest community members: