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 / Conditional formatting...
Power Apps
Unanswered

Conditional formatting ONLY for new record in gallery grid

(0) ShareShare
ReportReport
Posted on by 18

Hi. Any suggestions for how I could apply conditional formatting of controls in a gallery but ONLY for new records that a user adds with a Patch function? I have built a gallery grid with add/edit/delete functionality.

 

Here's the current Patch function called from an 'Add' button:

 

===============

//Create new row directly to datasource
Patch(
listResponses,
Defaults(listResponses),
{
Title: "**Enter details of Work Item**",
Week: cbFilterWeek.Selected,
Department: varUserDepartment,
Group: varUserGroup,
Role: varUserRole,
Location: varUserLocation
}
);

 

===============

 

The data source is a SharePoint List.

The gallery is populated from a filter of the data source.

Edits (not Adds) are managed with a temporary collection that is patched to the data source only when a 'Save' button is clicked.

 

Thanks in advance!

Categories:
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @jamezm79,

     

    You will have to keep track of which records where newly created by that user in that app instance. You could save the created IDs to a collection and check whether that row ID is in the collection in order to achieve conditional styling:

    Collect(
     colNewRecords,
     Patch(
     listResponses,
     Defaults(listResponses),
     {
     Title: "**Enter details of Work Item**",
     Week: cbFilterWeek.Selected,
     Department: varUserDepartment,
     Group: varUserGroup,
     Role: varUserRole,
     Location: varUserLocation
     }
     ).ID
    )

     

    In the TemplateFill property write (example):

    If(ThisItem.ID in colNewRecords, Color.Red)

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 402 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 296 Most Valuable Professional

Last 30 days Overall leaderboard