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

Gallery Labels not displaying in Live mode

Hello, 

         I am having a little problem with my galleries. While in power apps studio i can see the labels display text and images correctly. But once i am in Preview mode the text and labels disappear. 

My gallery is pulling its data from a collection. 

In studio mode i see the following

edit mode.PNG 

But once i click the play button i see this

live mode.PNG

 

I did do a little research before posting and found that some had suggested disabling the Explicit column selection option in the app settings. I have disabled this in my app but it hasn't made a difference. 

 

Please let me know if any additional information is needed.

14 REPLIES 14

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

Pstork1
Dual Super User III
Dual Super User III

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.

@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?

Pstork1
Dual Super User III
Dual Super User III

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.

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Did you miss the call? Check out the recording here!

Top Solution Authors
Top Kudoed Authors
Users online (22,386)