Hi there,
I have a gallery that contains multiple zones. In each zone, there is a gray rectangle.
Is it possible to change the color of the gray rectangle at the top after using the patch() function, without changing the color of the other rectangle at the bottom?
Thank you for your help
Thank you for the response, I see the logic!
@ArnaudH ,
I cannot see your data, so am only guessing here - as an example if you had the field LinkA in List A and LinkB in List B and they had the same value (a "key" field if you like) and the changed field was (to use my previous example) is called Status. If there was only one record in List B matching the record you want to colour in List A, then this is easy
If(
LookUp(
'List B'
LinkB = ThisItem.LinkA
).Status = "Completed",
Color.Green,
Color.Grey
)
If there are multiple matches in list A to the changed item in List B, then all those items in the gallery will turn green. There has to be a one-to-one relationship for this to work.
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
I don't quite understand the solution, do I need to import a value from List B to List A during the patch()?
It's also possible that multiple values in List B are the same. How do you handle these cases?
@ArnaudH ,
This is going to be more complex if at all possible. You are going to need a field in List A "linked" to the record in List B by a common value field and if you look it up for the changed value in List B, it is the only record in List A that will reflect the change (or more than one record in the gallery will turn green)
Thank you for the quick response.
I had already tried this solution but the problem is as follows: The information displayed in the gallery comes from a SharePoint list 'A', and the Patch() function writes to a SharePoint list 'B'. How is it possible to display data from two different sources in the same gallery?
Hi @ArnaudH ,
You need to patch a value to the record that you can then test for being present and the set the TemplateFill of the gallery accordingly. So for instance, if you changed a field called Status to Completed and wanted all completed fields to have a Green background, the TemplateFill of the Gallery would be
If(
ThisItem.Status = "Completed",
Color.Green,
Color.Grey
)
Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.
MVP (Business Applications) Visit my blog Practical Power Apps
WarrenBelz
146,631
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,991
Most Valuable Professional