cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Resolver II
Resolver II

Repeating Table - Collection - Display Mode after "Save"

Hi all,

I have a repeating table type screen and was trying to work out if possible to change each textbox / dropdown to the view display mode after that line has been collected and the new line starts.

I've tried using - Set(dropdowntest,DisplayMode.View) - on the save button but it changes the property on the next line too.

Any suggestions please?

Thanks

PPSA_0-1596717991368.png

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Great, this should be straightforward then!

 

Add a column for your collect statements, called something like "appCurrentRow"

 

On the initial collect set it equal to true. We can then use this value to set the DisplayMode (Edit Mode) of the controls in the gallery.

 

A simple function should suffice:

If ( ThisItem.appCurrentRow, DisplayMode.Edit, DisplayMode.Disabled )

 

Bonus tip: you can select multiple controls at once and set the property for all of them at once, in the formula bar.

 

Now we'll need to toggle old rows and set it on new rows. Add this function to whenever you're adding the 2nd+ row.

 

UpdateIf ( colName, appCurrentRow, { appCurrentRow : false } )

 

That will set any rows toggle from true to false. Simply set the new rows appCurrentRow to true, after that, and you'll have a mix of enabled and disabled rows.

View solution in original post

6 REPLIES 6
Highlighted
Super User II
Super User II

What is the data source of the gallery? Are you getting rows from an external source or using a local collection?

 

A few ways to do this, but depends on what the source of the gallery is.

 

Your formula is getting a variable which applies to all rows of the gallery. Instead, you'll need to base it on the row itself using ThisItem or referencing a sibling controls value/property.

Highlighted

Hi @GarethPrisk .

Source is a collection,

When opening the page I create the collection with blanks to show the first line,

My save button patches the inputs to the collection and then collects another set of blanks for the next line to appear.

Highlighted

Great, this should be straightforward then!

 

Add a column for your collect statements, called something like "appCurrentRow"

 

On the initial collect set it equal to true. We can then use this value to set the DisplayMode (Edit Mode) of the controls in the gallery.

 

A simple function should suffice:

If ( ThisItem.appCurrentRow, DisplayMode.Edit, DisplayMode.Disabled )

 

Bonus tip: you can select multiple controls at once and set the property for all of them at once, in the formula bar.

 

Now we'll need to toggle old rows and set it on new rows. Add this function to whenever you're adding the 2nd+ row.

 

UpdateIf ( colName, appCurrentRow, { appCurrentRow : false } )

 

That will set any rows toggle from true to false. Simply set the new rows appCurrentRow to true, after that, and you'll have a mix of enabled and disabled rows.

View solution in original post

Highlighted

Thank you, @GarethPrisk .

Works perfectly.

Highlighted
Advocate II
Advocate II

Hi @PPSA

 

Not a direct answer to your query but I have a similar gallery and my approach was to make only the item selected editable:

LooseChippings_0-1596799413156.png

using If(ThisItem.IsSelected, DisplayMode.Edit, DisplayMode.View) for each of the input fields.

Highlighted

I like the approach, @LooseChippings , if selecting a row means it should be editable. If you need to keep a row locked after a certain point, then the data-oriented approach allows this.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (8,500)