web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery: Hide blank it...
Power Apps
Answered

Gallery: Hide blank items for any given visible column

(0) ShareShare
ReportReport
Posted on by 42

Scenario:

  • I have a SP list (TIPS) that was created from a Quiz Form (MS Forms) consisting of 8 questions/columns.
  • Each "question" was reformatted in preparation to export to SP as table column headers.
    • example: C1, C2, C3, etc.
  • I've created a flow to add new submissions from the MS Form to the list using Power Automate.
  • I've created a "simple" PowerApp to add as a tab in Teams to display the results of the Quiz.
  • The PowerApp consists of two galleries.
    • selecting any given Gallery1 item updates a variable (varTips) with that text
    • a text label in the gallery has a switch statement that compares varTips to all 8 column names and essentially outputs thisitem.vartips < essence of the formula
    • this set up was the only way I could isolate a given column's content
    • Gallery1 is a static list of the column names that correspond to the SP list columns (TIPS)
    • Gallery2.items is set to the SP list
  • All of this works great to give me the related column content for every record in the list

 

Problem:

  • Some records have blank items (data) for a given column
    • example: record 1 may have all 8 "questions" (C1 - C8) with responses; however, time ran out for record 2 and only 4 of the 8 have responses, as conceptually illustrated below in the table

Record

C1

C2

C3

C4

C5

C6

C7

C8

1

data

data

data

data

data

data

data

data

2

data

data

data

data

 

 

 

 

3

data

data

data

data

data

 

 

 

  • If I select in Gallery1, the C1 item which through switch displays only the C1 column data in Gallery2, I'll get three rows of data, as expected
  • If I select in Gallery1, the C5 item, then what I get is still three rows in Gallery2, but the second row does not have data, so my Gallery2 conceptually looks like this:

C5

data

 

data

 

Question:

How do I filter out any given displayed column to only show records that are not blank in that particular item?

 

Example flows of wanted outcome: 

1. Gallery1 > select C5 item > Gallery2 > display only 2 rows: Record 1 & 3.

2. Gallery1 > select C7 item > Gallery2 > display only 1 row: Record 1.

3. Gallery2 > select C2 item > Gallery2 > display 3 rows, etc.

 

I've attempted to put together a filter formula, but since the column is not static, I don't think I can filter out the blanks that way.

 

Any ideas on how I can achieve this?

Categories:
  • Verified answer
    v-bofeng-msft Profile Picture
    Microsoft Employee on at

    Hi @RussW :

    If my understanding is correct, I suggest you use the combination of Switch\Filter\IsBlank.I've made a test for your reference:

    1\add a gallery(Gallery4😞

    Items:

     

    ["C1","C2","C3","C4","C5","C6","C7","C8"]

     

     2\add an other gallery:

    Items:

     

    Switch(
     Gallery4.Selected.Value,
     "C1",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C1)),"C1"),"C1","Value")
    , "C2",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C2)),"C2"),"C2","Value")
    , "C3",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C3)),"C3"),"C3","Value")
    , "C4",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C4)),"C4"),"C4","Value")
    , "C5",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C5)),"C5"),"C5","Value")
    , "C6",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C6)),"C6"),"C6","Value")
    , "C7",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C7)),"C7"),"C7","Value")
    , "C8",RenameColumns(ShowColumns(Filter(theSPlist,!IsBlank(C8)),"C8"),"C8","Value")
    )

     

    32.gif

    Best Regards,

    Bof

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 226 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 191 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 167

Last 30 days Overall leaderboard