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 to mark the curren...
Power Apps
Answered

how to mark the current record as "dirty" in a Gallery Control

(0) ShareShare
ReportReport
Posted on by 358

Hi, we are using a gallery control in our PowerApp...

 

The gallery is linked to a de-normalized SharePoint List that cannot be changed as it is used a source by external applications...

 

The list consists of boxes, of several items. The boxes are identified by the box no, and the store code (T-Code). In the below image you can see what the list looks like - there are 3 columns highlighted in red, and these are the columns that would trigger an update on the list, for all records with that T-Code and BoxNo:

Capture4.PNG

 

At the box level, the user can change any one of those 3 fields in the gallery, and when they are changed, all of the records in the list for that box are to be updated...

 

The problem is that this means the user has to put up with waiting several seconds while the list is patched, for each of the child items in that box.

 

The user can modify 3 fields in the gallery, and when they are changed, all the child items are updated using Patch in a ForAll

 

So when the user makes a change, we want to mark the record as dirty in the gallery, and enable the Update button for that record so the user can choose when to update the box ...

Capture2.PNGCapture3.PNG

 

Currently you can see we have an Edit box checkbox at the left of the gallery, and we use that to control the DisplayMode of the Update button...

 

So how can we get rid of the checkbox, and have the record marked as Dirty when the user changes either of the three fields Delivery Method, Tote (Yellow Tag) ID ("SealNumber" in the List), or Preferred Collection Date

 

We cannot use a dirty variable as it would be general for all records in the gallery thanks for any help or advice

Categories:
  • Verified answer
    v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @livingstonep,

    Do you want to get rid of the checkbox, and have the record marked as Dirty when the user changes either of the three fields?

    Could you please share a bit more about the DeliveryMethod column in your SP list? Is it a Choice type column?

    I have made a test on my side, please take a try with the following workaround:7.JPG

    Set the DisplayMode proeprty of the "Update" button to following:

    If(
    Dropdown1.Selected.Value<>ThisItem.DeliveryMethod || TextInput1.Text<>ThisItem.SealNumber || Text(DatePicker1.SelectedDate)<>ThisItem.PreferredCollectionDate,
    DisplayMode.Edit,
    DisplayMode.Disabled
    )

    On your side, you should type the following:

    If(
    DeliveryMethodDropdown.Selected.Value <> ThisItem.DeliveryMethod.Value ||
    Tote(Yellow Tag)IdTextInput
    .Text <> ThisItem.SealNumber ||
    Text(PreferredCollectionDatePicker1.SelectedDate) <> Text(ThisItem.PreferredCollectionDate),
    DisplayMode.Edit,
    DisplayMode.Disabled
    )

    Note: I assume that the DeliveryMethod column in your SP list is a Choice type column.

    Please check the attached GIF screenshot for more details:

     

    Best regards,

    Kris

    Test1.gif
  • livingstonep Profile Picture
    358 on at
    Hi kris, yes the Delivery Method is a choice field... your help is very much appreciated... However, one question I have, how do we ensure that all other records in the gallery are locked/read-only until either the current record is updated, or cancelled? thanks for this...
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @livingstonep,

    Do you want the other records to be locked/read-only until the current record is updated or canceled?

    If you want the other records to be locked/read-only until the current record is updated or canceled, I have made a test on my side, I afraid that there is no way to achieve your needs in PowerApps currently.

     

    Best regards,

    Kris

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 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard