cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
livingstonep
Kudo Commander
Kudo Commander

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-xida-msft
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

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
Community Support
Community Support

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

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,196)