cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
barrymac20
Helper IV
Helper IV

One Gallery per List or One gallery for all lists

Hi All.

 

I have a screen that is used to view/update 7 Sharepoint lists. All the lists have the same format of columns.

 

Is it best practive to have a gallery for each list (i.e. 7 galleries that are hidden/shown depending on variable) or should I have one gallery for all 7 lists (i.e. datasource is based on if statement/variable).

 

Barry

1 ACCEPTED SOLUTION

Accepted Solutions

@barrymac20 

I would organize the Items property like this and rely-on a single variable rather than 7 variables.  Not sure if its faster, but its worth a shot!

Switch(
    varWhichDatasource,
    "ACB", Sort(collMCCBProductlist,ID),
    "ACB_Ass", Sort(collACBAccessoriesProductlist,ID),
    "MCCB", Sort(collMCCBProductlist,ID),
    "MCCB_Ass", Sort(collMCCBAccessoriesProductlist,ID),
    "ILine", Sort(collILineProductlist,ID),
    "IC", Sort(collInstrumentationCableProductlist,ID),
    "Sundries", Sort(collSundriesProductlist,ID)
)


Sorry, I don't have a suggestion for your PATCH function at this time.  You may wish to post it as a new question so it gets the attention it deserves.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

3 REPLIES 3
mdevaney
Super User
Super User

@barrymac20
Having only 1 gallery for 7 lists with the same structure is my own 'best practice' in this scenario because its less work to maintain.  But the 7 lists it displays data from must always have all the same formats and columns.  You'll have to make sure all lists maintain parity.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up." 

Cheers.

 

I starteed out with 7 galleries but its a pain to make changes. I'm currently updating so I have only one gallery and I have noticed that it is a tad bit slower cycling between the datasources but I do think it will perform better in the long run.

 

This is my if statement for the gallery Items. The variable is a true or false value depending on the button selected. Any suggestions to improve?

 

If(varACB, Sort(collMCCBProductlist,ID),

If(varACB_Ass, Sort(collACBAccessoriesProductlist,ID),

If(varMCCB, Sort(collMCCBProductlist,ID),
If(varMCCB_Ass, Sort(collMCCBAccessoriesProductlist,ID),

If(varILine, Sort(collILineProductlist,ID),

If(varIC, Sort(collInstrumentationCableProductlist,ID),
If(varSundries, Sort(collSundriesProductlist,ID)

)))))))

 

This is my patch code that updates a quantity field in the relevant list. Any suggestions to improve?

 

Patch(

    If(varACB, 'ACB Product List',

    If(varACB_Ass, 'ACB Accessories Product List',

    If(varMCCB, 'MCCB Product List',

    If(varMCCB_ass, 'MCCB Accessories Product List',
    If(varILine, 'I-Line Product List',
    If(varIC, 'Instrumentation & Cable List',

    If(varSundries, 'Sundries Product List'
    ))))))),

        First(Filter(

        If(varACB, 'ACB Product List',

        If(varACB_Ass, 'ACB Accessories Product List',

        If(varMCCB, 'MCCB Product List',

        If(varMCCB_ass, 'MCCB Accessories Product List',
        If(varILine, 'I-Line Product List',
        If(varIC, 'Instrumentation & Cable List',

        If(varSundries, 'Sundries Product List'
        ))))))),


            ProductID=ThisItem.ProductID And PartID = ThisItem.PartID)), {Quantity: Value(TextInput4_12.Text)});

 

ClearCollect(

    If(varACB, Sort(collMCCBProductlist,ID),

    If(varACB_Ass, Sort(collACBAccessoriesProductlist,ID),

    If(varMCCB, Sort(collMCCBProductlist,ID),
    If(varMCCB_Ass, Sort(collMCCBAccessoriesProductlist,ID),

    If(varILine, Sort(collILineProductlist,ID),

    If(varIC, Sort(collInstrumentationCableProductlist,ID),
    If(varSundries, Sort(collSundriesProductlist,ID)

    ))))))),

        Filter(

        If(varACB, 'ACB Product List',

        If(varACB_Ass, 'ACB Accessories Product List',

        If(varMCCB, 'MCCB Product List',

        If(varMCCB_ass, 'MCCB Accessories Product List',
        If(varILine, 'I-Line Product List',
        If(varIC, 'Instrumentation & Cable List',

        If(varSundries, 'Sundries Product List'
        ))))))), 

            ProductID = Value(varThisProductInfo.ProductID)));

@barrymac20 

I would organize the Items property like this and rely-on a single variable rather than 7 variables.  Not sure if its faster, but its worth a shot!

Switch(
    varWhichDatasource,
    "ACB", Sort(collMCCBProductlist,ID),
    "ACB_Ass", Sort(collACBAccessoriesProductlist,ID),
    "MCCB", Sort(collMCCBProductlist,ID),
    "MCCB_Ass", Sort(collMCCBAccessoriesProductlist,ID),
    "ILine", Sort(collILineProductlist,ID),
    "IC", Sort(collInstrumentationCableProductlist,ID),
    "Sundries", Sort(collSundriesProductlist,ID)
)


Sorry, I don't have a suggestion for your PATCH function at this time.  You may wish to post it as a new question so it gets the attention it deserves.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,805)