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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Hide Gallery if DatePi...
Power Apps
Answered

Hide Gallery if DatePicker Blank

(0) ShareShare
ReportReport
Posted on by 5,331 Moderator

I have four Galleries. I want the visibility of each controlled
by the contents of each gallery's DatePicker. If the DatePicker
is blank hide the gallery.

Phineas_0-1702410286434.png


Each DatePicker has a version of the following formula.

If(!IsBlank(Edit_PO_Reference_ID_Fld.Text), ThisItem.First_Purchase_Order_Revision_Date,Blank())

 

The only gallery that has a blank DatePicker (which is also
blank in the SharePoint list) is Gallery3, yet all Galleries are
visible. I can't figure out how to control the visibilities of the
galleries.

If I change the formula to !IsBlank...all of the galleries are
hidden.

What am I missing?

Goal, is Gallery DatePicker is blank hide Gallery.

Phineas_1-1702410385311.png

 

Categories:
I have the same question (0)
  • scalca Profile Picture
    on at

    I'm not sure if this is what you are looking for
    DatePicker DefaultDate = ThisItem.'SP List Date Column'

    Gallery Visible = If(IsBlank(DatePicker1.SelectedDate), false, true) 

     

    hope this helps

  • Phineas Profile Picture
    5,331 Moderator on at

    Thank you for your reply.

    These things together are not delivering the desired results.

    I have copied in your recommendation, but the visibility is still not working correctly.

    The DatePickers have a version of the following formula. You can see in the example the Refence ID is RS00007310. If the Reference ID text field is blank set the DatePicker to blank.
    If(!IsBlank(Edit_PO_Reference_ID_Fld.Text),ThisItem.Fourth_Purchase_Order_Revision_Date,Blank())

    Phineas_2-1702417136152.png

     

    Here I have forced 'true' so you can see the DatePicker has content.
    Phineas_0-1702416863280.png

    Here I am just using the formula, and even with data in the DatePicker the gallery is hidden.

    Phineas_1-1702416906803.png

     

  • AARON_C Profile Picture
    2,235 Most Valuable Professional on at

    Hi again @Phineas,

     

    Could you please tell me more about your data source and how you are displaying it in your gallery.

     

    Also, just making sure I understand your end goal. The first gallery should be visible if you have a value in your Reference ID input (The other 3 are still not visible at this stage?). Once a date is selected in the first gallery, gallery 2 should become visible (remaining 2 still not visible). And so on.

  • Phineas Profile Picture
    5,331 Moderator on at

    Data Source is a SharePoint list.

    There is a main gallery, in which there 10-12 other sub-galleries. Each sub-gallery has a DatePicker (Date/Time in SharePoint) and Amount (Number in SharePoint).

    The Galleries represent revision to a Purchase Order - in order.

    The first is the 'Original PO' (DatePicker and Amount have Original PO in column name).

    Every revision/gallery has its own DatePicker/Amount field - 1st Revision, 2nd Revision, 3rd Revsion, 4th Revision...

    The revision are completed in order. Some purchase orders only have the 'Original PO', other may have the 'Original PO' and several revisions

    The main gallery is filtered by a set of parameter so that only the revision associated with on purchase order are returned.

    I have all 10-12 sub-galleries in the main gallery. I only want the galleries to appear as dates and amount are added. The order will always be Original, 1st, 2nd, 3rd...

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi,

     

    It looks like you are setting the visibility property at the gallery level based on the pictures provided.

     

    If you want ONLY the datepicker to be visible/not, then you need to set the Visible property on the Datepicker control - what you have selected in the pictures is the row (which is effectively the gallery itself), and if my suspicions are correct, this is one gallery with four items in it? in which case setting the visibility at the parent level will affect all of them if ANY of the row items are blank, as you are affecting them based on the Control not on the row item.

     

    Default property of Datepicker remains as you have it:

    If(
     !IsBlank(Edit_PO_Reference_ID_Fld.Text),
     ThisItem.First_Purchase_Order_Revision_Date,
     Blank()
    )

     

    Now change the Visible property of the Datepicker to:

    Len(Self.SelectedDate)>0

     

    Cheers,

    Sancho

     

  • Phineas Profile Picture
    5,331 Moderator on at

    Forgive the confusing images.

     

    It is the nested galleries I want hidden. based on the content of each of their DatePicker fields.

     

    There is one main gallery with a scroll bar. This will allow the user to scroll through all visible nested galleries.

     

    All 10 nested galleries re always present in the main gallery, however the nested gallery should only be visable if it's DatePicker has a date in it.

     

    Each nested gallery represents a potential revision to the original purchase order -  the original order (always first), then 1 -10, always in that order. 

     

    if no revisions are ever created only the Original PO gallery is ever visible.

     

    !IsBlank('specific revision DatePicker.selecteddate') has not worked.

     

    Neither has If(IsBlank('specific revision datepicker.selecteddate),true,false).

     

    I hope this is more clear, thank you.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Ok that's actually very useful info - can you elaborate a bit more on the nested galleries - are these going to be used to do the modifications or are we simply displaying/viewing the revision items that have been stored elsewhere?

     

    The reason I ask is that your datepicker values are currently dependent on the values from the text field - but you are trying to show/hide the row (nested gal) depending on the datepicker values - which means that if your text field has no value then the datepicker will be invisible which means the row is invisible right? but that means there's no way for anyone to edit the items as they will be invisible by default for all rows that have no date, with no way to change them

  • Phineas Profile Picture
    5,331 Moderator on at

    There is no 'edit' capability required for the nested galleries. They only display the saved data associated with each Revision.

     

    Each revision type has its own line item in the data source, and there are columns for each revision date and amount.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Ok, so last question - what is the Default property for that text field set to?

    (Edit_PO_Reference_ID_Fld)

  • Phineas Profile Picture
    5,331 Moderator on at

    The 'Edit_PO_Reference_ID_Fldfield has the following LookUp formula -
              If(!IsBlank(Edit_PO_Reference_ID_Dropdown_Fld.Selected.Value),Edit_PO_Reference_ID_Dropdown_Fld.Selected.Value,"")

    Also, in case it has an impact, the 'Main Gallery' (in which the nested galleries are place has the following formula, to limit the run-on of the gallery -
         First(PO_Tracking_Collection)

    Phineas_1-1702487501021.png

     

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
Kalathiya Profile Picture

Kalathiya 321 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 289 Most Valuable Professional

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 200 Super User 2026 Season 1

Last 30 days Overall leaderboard