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

Re: Gallery Labels not displaying in Live mode

@edwardmontag  Thanks for the suggestion. I gave it a go and unfortunately it didn't work. But it was worth a try.

Highlighted
Dual Super User II
Dual Super User II

Re: Gallery Labels not displaying in Live mode

I handle empty galleries by centering a label over the gallery with text like "No Records Found".  Then set the visible property to check if the gallery has no rows.

If(CountRows(galleryName.AllItems)>0,false,true)

If the gallery is empty then the Row count will be 0 and the label will be visible.  If the gallery has records then then label will be invisible. 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Resolver I
Resolver I

Re: Gallery Labels not displaying in Live mode

@Pstork1 Thanks for the suggestion. As my screen is setup in tabs, with each tab having a visible property assigned to it i cannot get your suggestion to work. As it does technically work , but shows up under every tab. 

 

You mentioned that the problem is due to the gallery not having any records. Is there a way to run a check on the items property of the gallery to see if there are any records, and if not set some default ones. 

For example the gallery pulls its data from a collection (colSS) . In our case there are no records in that colSS that match the the required lookup (LookUp(colSS,JobTitle="Manager FSS AR TCAS")) . So is there a way to add a record to the collection that adds data needed. So if lookup fails add a record so it doesnt fail?

Highlighted
Dual Super User II
Dual Super User II

Re: Gallery Labels not displaying in Live mode

The code I listed using CountRows() is the way to check if the Gallery has any items.  And yes, you should be able to use that in some way to add a record to the collection if its empty.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.
Highlighted
Resolver I
Resolver I

Re: Gallery Labels not displaying in Live mode

Thank you for you help.

 

I have managed to get this working. To solve it i have to go back to the code that collects the data and puts it into the collection i.e a button that when pressed collects the data.  

For anyone else interested in knowing the solution here is the code i used.

//Collect Tab Group
ClearCollect(
    colSS,
    Filter(
        colAll,
        Division.Value = "SS"
    )
);
If(
    !IsBlank(
        Filter(
            colSS,
            JobTitle = "Director, Internal Controls & Policy",
            JobTitle = "BCR/CAFR Manager",
            JobTitle = "Deputy Director, Financial Reporting",
            JobTitle = "CAFR Manager"
        )
    ),
    Collect(
        colSS,
        {
            FullName: "Vacant",
            JobTitle: "Director, Internal Controls & Policy"
        },
        {
            FullName: "Vacant",
            JobTitle: "BCR/CAFR Manager"
        },
        {
            FullName: "Vacant",
            JobTitle: "Deputy Director, Financial Reporting"
        },
        {
            FullName: "Vacant",
            JobTitle: "CAFR Manager"
        }
    )
);

 

To break this down a little 

ClearCollect(
    colSS,
    Filter(
        colAll,
        Division.Value = "SS"
    )
);

This is filtering our main collection that contains a data dump from a sharepoint list. It is filtering it and returning only the records that match the division.value of SS. It puts all these returned results in the collection colSS.

 

If(
    !IsBlank(
        Filter(
            colSS,
            JobTitle = "Director, Internal Controls & Policy",
            JobTitle = "BCR/CAFR Manager",
            JobTitle = "Deputy Director, Financial Reporting",
            JobTitle = "CAFR Manager"
        )
    ),

Here we are checking the newly created colSS to see if there are records that are not blank containing the different JobTitles. 

 

 

Collect(
        colSS,
        {
            FullName: "Vacant",
            JobTitle: "Director, Internal Controls & Policy"
        },
        {
            FullName: "Vacant",
            JobTitle: "BCR/CAFR Manager"
        },
        {
            FullName: "Vacant",
            JobTitle: "Deputy Director, Financial Reporting"
        },
        {
            FullName: "Vacant",
            JobTitle: "CAFR Manager"
        }
    )
);

 If any do come back blank then new records are added to the collection adding the JobTitle and the FullName "Vacant".

 

Hope that makes sense 🙂

View solution in original post

Helpful resources

Announcements
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,751)