web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How/where would I add ...
Power Apps
Unanswered

How/where would I add in the sequence for the row number so hence coloring

(0) ShareShare
ReportReport
Posted on by 678

My goal is to end up with a RowNo that I can do a template fill for the value to do alternating colors...

If(
 Mod(
 ThisItem.RowNo,
 2
 ) = 0,
 ColorValue("#F4FAFF"),
 White
)

I know the patching for this has to come AFTER the filtering and existing code but can someone assist please before I screw up all the hard work I've done to get this code working...Is it a 2nd patch?
This is the piece needed to be added where we patch the RowNo

ForAll(
 Sequence(CountRows(records)),
 Patch(
 Last(
 FirstN(
 records,
 Value
 )
 ),
 {RowNo: Value}
 )
 )

Here's the code...

Filter(
 ForAll(
 ProjectStatus2 As _p,
 With(
 {
 DP1Start: If(
 DateDiff(
 DatePickerStart,
 _p.StartDate,
 Days
 ) < 0,
 0,
 DateDiff(
 DatePickerStart,
 _p.StartDate,
 Days
 )
 ),
 DP1End: DateDiff(
 DatePickerStart,
 _p.DueDate,
 Days
 ),
 DP2Start: DateDiff(
 DatePickerStart,
 _p.DueDate,
 Days
 ),
 DP2End: DateDiff(
 DatePickerEnd,
 _p.DueDate,
 Days
 ),
 DD: DateDiff(
 DatePickerStart,
 DatePickerEnd,
 Days
 )
 },
 With(
 {PxlUnit: GalDates_1.Width / DD},
 With(
 {
 BarInRange: If(
 (DP1Start = 0 && DP1End < 0) || (DP2Start > DD && DP2End > DD),
 false,
 true
 ),
 BarX: If(
 DP1Start = 0,
 GalDates.X,
 If(
 DP2Start > DD,
 Self.Width,
 ((DP1Start * PxlUnit) + GalDates.X)
 )
 ),
 BarWidth: If(
 DP2End >= DD,
 Self.Width,
 If(
 DP2Start < 0,
 0,
 (DP1End * PxlUnit)
 )
 )
 },
 Patch( 
 _p,
 {
 BarX: BarX,
 BarWidth: BarWidth - (BarX-GalDates.X),
 BarInRange: BarInRange,
 DD: DD,
 DP1Start: DP1Start,
 DP1End: DP1End,
 DP2Start: DP2Start,
 DP2End: DP2End,
 PxlUnit: PxlUnit
 }
 )
 )
 )
 )
 ),
 (DrpGanttStatus.Selected.Title = "All" || Progress = DrpGanttStatus.Selected.Title) && (DrpInRange.Selected.Value = "Show All" || If(
 DrpInRange.Selected.Value = "Show Items in Range",
 BarInRange,
 !BarInRange
 )) && (DrpGanttCategories.Selected.Title = "All" || ProjectCategory = DrpGanttCategories.Selected.Title)
)



Categories:

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 396 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 323

#3
WarrenBelz Profile Picture

WarrenBelz 193 Most Valuable Professional

Last 30 days Overall leaderboard