Is it possible to fill the rows of a gallery with alternate colors?
I've tried the following to the "Fill" property of my gallery:
If(Mod(Value(ThisItem.ID);2)=0; Color!Aqua; Color!AliceBlue)
But it's not working (returns a single color for the whole gallery).
My data source has an ID column
Solved! Go to Solution.
You could use a DATEDIFF formula that counts the number of days since the epoch and determines whether they are divisible by two.
If(Mod(DateDiff(Date(1970,1,1),ThisItem.Date),2)=0, Color!Aqua; Color!AliceBlue)
Alternately, I have a method of adding row numbers to Collections that can be found in my free Collections Cookbook app:
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Right idea, wrong property. Put your code in the TemplateFill property instead.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Have you tried removing the Value:
If(Mod(ThisItem.ID);2=0; Green;Blue)
Also is your ID Column Unique
------------
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.
That works!
However, I now realize the gallery is ordered by date, thus the ID is not the right criteria to use for the colors.
It should be he order number, somehow. Is it possible?
You could use a DATEDIFF formula that counts the number of days since the epoch and determines whether they are divisible by two.
If(Mod(DateDiff(Date(1970,1,1),ThisItem.Date),2)=0, Color!Aqua; Color!AliceBlue)
Alternately, I have a method of adding row numbers to Collections that can be found in my free Collections Cookbook app:
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.
User | Count |
---|---|
259 | |
126 | |
86 | |
85 | |
68 |