I'm trying to update one value in a List, based on one toggle control value, inside a gallery but the instruction is updating several rows instead of only one, the instruction is:
ProcessID = ThisItem.ProcessesID && ListToUpdateID = listToUpdateValue
The ListToUpdateID value is 2 and there are 9 rows associated with ProcessesID (1, 2, 3, 4, 5, 6, 7, 8, 9), the value of ThisItem.ProcessesID is 3 but the instructionis updating the 9 values related to ListToUpdateID
Watch this tutorial on Patch from Gallery:
If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.
Do you need the ListToUpdateID = listToUpdateValue condition? If you are simply using the LookUp to filter the List with a unique ID then simplify and take out this second condition. Also, is it possible that these variables are ambiguous? Might be worth being explicit and using ThisRecord. or As as in here: Patch function - Power Apps | Microsoft Docs
Hi, yes I need both conditions because my list is like:
ListToUpdateID ProcessID more fields...
Hi, it looks like I'm using the instruction correctly but is not working, is not updating just the required value, is updating all of them
Hi @PincheMaldy ,
By default, LookUp function will return the first single record that matches one or more conditions, so do you have any other code like ForAll? If yes, please provide your full code. If no, try to add a new button, and only use Patch inside this button, then check the result.
If above still cannot solve your issue, from your code, seems that you want to update the record that “ListToUpdateID =2 && ProcessID=3”, and I want to make sure below things:
1. Where do you use this Patch code? Inside the gallery beside each record? Or outside the gallery?
2. What's the relationship of the toggle control?
3. What is the “listToUpdateValue” mean inside your formula? Is this a column name in your list?
4. Your gallery is not connect to the ListToUpdate list, and it has another similar column name called “ProcessesID”(not same as "ProcessID"). Am I right?
For better understand your issue, you can also provide some screenshots about your gallery and other configurations.
Check out new user group experience and if you are a leader please create your group
Did you know that you can visit the Power Query Forum in Power BI and now Power Apps
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.