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 displays corre...
Power Apps
Answered

Gallery displays correct value but isblank function says its blank. Issue with Refresh of Sharepoint Table.

(0) ShareShare
ReportReport
Posted on by 78

Hello, I am working on a APP which needs IF statements to make sure the app only does certain things if they are true. I am currently experience issues with one of my buttons and I am unable to solve it. 

 

On "page1" I select a specific value which I use to filter a gallery on "page2. 

 

Page 1:

PhilipL_0-1678198397049.png

When I press the button in the bottom of the Page1 I have the following code:

Set(VariableOne, 'ItemID Text Box'.Text);

Refresh(SharePointTable);

Navigate(Page2); 

On Page 2 I filter the Gallery with Filter(SharePointTable, ItemIDLocation = VariableOne&'Location text box'.Text.

 

PhilipL_1-1678198599555.png

I have added two text boxes in the bottom of the screen which says:

If(Len(GalleryPickingLocationTextBox.Text) >0 , "Gallery Not Blank", Gallery Blank") 

If(!Isblank(GalleryPickingLocationTextBox.Text), "Gallery Not Blank", "Gallery Blank)

As can be seen in the picture above the test says "Gallery Not Blank".

However, if I now navigate back to the Page 1 and use another ItemID, Page 2 i all of the sudden saying that the Gallery is blank. However, the Gallery is displaying the correct values. 

PhilipL_2-1678199085911.png

PhilipL_3-1678199167181.png

 

I have in the top corner of Page 2 a refresh button where I have function:

Refresh(SharePointTable) 

And if I press this button the functions suddenly says the gallery is not blank:

PhilipL_4-1678199281139.png

 

In my button in the bottom of Page 2 I have the code: 

Refresh(SharePointTable);
IF(!IsBlank(GalleryPickingLocationTextBox.Text, Navigate(Page3), false)

I am unable to use this button when the text says "Gallery Blank"  even if I have added a "Refresh" before the If statement. However If I "double klick" on the button it works of course because after I have refreshed the the table it works the 2nd time. 

I don't understand what I need to here to make it work. I have a Refresh on the previous page before I navigate to this page and I have a Refresh on the actual button, but for some reason I need to do a manual refresh of the SharepointTable before !IsBlank funktion is working.  But as you can see form the picture the Gallery is not empty. It Contains the right values.

 

Categories:
  • PhilipL Profile Picture
    78 on at

    The Warning triangle that can be seen on the Page 2 button is a deligation warning and unrelated to this topic. The button does what it is suppose to do one the Isblank(gallery) function doesn't say the gallery is blank. 

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @PhilipL ,

     

    Could you please share true formulas along with the Controls they are referencing with screenshots?

     

    Best regards,

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PhilipL

    IF(!IsBlank(GalleryPickingLocationTextBox.Text ")" is missing

  • PhilipL Profile Picture
    78 on at

    First Time I use the Page:

    PhilipL_5-1678342762046.png

    2nd time I use the page 

    PhilipL_6-1678342795121.png


    My manual Refresh button 

    PhilipL_7-1678342878292.png


    After I press the Manual refresh 

    PhilipL_10-1678343151654.png

     


    My Button which works the first time I am on the Page but no the 2nd time. Meaning I can Single click the first time I am on this page, but every other time I am on this page (within the same session) I need to double click or use the Refresh button. 

    PhilipL_9-1678342977867.png

    It is like the Refresh statements doesn't occur before the If statement. 

    I can probably build the button to trigger a timer which at start does refresh and then counts for a few seconds and in the end does the If statement, but I much rather understand what I am doing wrong here, so I can prevent this from happening on more pages. 

    On my navigation button on Page 1 which navigates me to page 2, I also have:

    PhilipL_11-1678343237703.png



    So have refresh of the Sharepoint tables on both the navigation to page 2, on the button on page 2, but neither work. I must use a manual 3rd button. Makes no sense to me. 

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    @PhilipL

    Please to troubleshoot, change IsBlank(...) to Len(...) = 0 and see if you get a different result. 

  • PhilipL Profile Picture
    78 on at

    As I posted in the first post The second text you see is Len comand

    PhilipL_0-1678347589907.png

     

    So this is not working either. 

  • NZ0090 Profile Picture
    317 on at

    @PhilipL Correct me if I'm wrong, your gallery is showing data but the text says "Gallery Blank" and you want it to show the opposite ("Gallery Not Blank") right? Can you try replacing it with CountRows(GalleryName.AllItems) instead? Maybe something like this?

     

     

     

    If(CountRows(GalleryName.AllItems)>0, "Gallery Not Blank", "Gallery Blank")

     

     

     

     

  • PhilipL Profile Picture
    78 on at

    Hello, This seems to work. Code wise.  

    PhilipL_0-1678355058621.png

    However, while this new code enables me to use the button and navigate to page 3, the values from the gallery of Page 2 is not correctly fetched. Cause on Page 3 all my values are blank where I do a Filter based on the Gallery from page 2. 

    So while the:

    If(CountRows(GalleryName.AllItems)>0, "Gallery Not Blank", "Gallery Blank")

     

    Does is true, it still seems like the values in the gallery is not updated and when I use the Button on Page 2 which fetch the field from the Gallery, it is the wrong info now. 

     

  • NZ0090 Profile Picture
    317 on at

    @PhilipL

    Just a couple of questions so I have a clear idea on what you're expecting.

    1. Do you see the correct data inside the gallery in Page 2? Or is nothing showing up Page 2 gallery at all?

    2. What do you expect to see on Page 2? Gallery with Items filtered by value in Page 1?

    3. What value exactly do you want to pass to Page 3? First value of Gallery 2?

    4. Can you give sample screenshots of what you expect to happen and what is currently happening right now?

  • PhilipL Profile Picture
    78 on at

    I will try to explain it all in more details. Thansk for helping out!

    First I have Page1, where I search for a Item code, which then filters down a Table of locations where this item is stored. 

    When you press on the Navigate to pick page 2 button I have the following code:

    Refresh(SharepointTable);
    Set(SelectedItem, itemWeSearchedFor); //The textbox.text
    Navigate(Page2)

    On Page 2 we select the Location we want, in a text box. You can either enter free-text or it is pre-filled with the selected table row from the first page. 

    On page 2 I then have a gallery displaying filtered:
    FIlter(SharepointTable, Key =  SelectedItem&"-"&LocationTextBox.Text) 

    On the Navigation button on  Page 2, have the IF-statement:


    Refresh(SharepointTable);
    If(!isblank(gallery-Location-text-box),Set(SelectedLocation, Gallery-Location-Text-Box); Navigate(page 3), False)


    Now lets say I start up the APP. 

    1. I go to Page 1 and search a Item. -- It works and I see the right item and the table shows me all locations.
    2. I go to Page 2 and search a Location. -- It works and the gallery shows the right item + location.
    3. I press Page 3 and can see in the Gallery on page 3 the correct values. 
    4. I go back to Page 1 (where the back button has refresh(sharepoint table).
    5. I select a new Item -- It works and I see the right item and the table shows me all locations.
    6. I go to page 2 and selects a Location. It "works" and the gallery displayes the right item and the right location.
    7. I press the button to navigate to page 3. -- It doesn't work because it says that the Gallery is Empty. 

    If I then Press another button I have on Page 2 which does : Refresh(SharepointTable), the button below works. But even if I have Refresh(Sharepoint Table) function on both the navigation button from page 1 -> page 2, and on the Navigation button from Page 2-> Page 3, I need press a separate button for it to work. It is like the button doesn't do the functions in a sequence. 

    So I need to understand why I can see the correct value in the Gallery, but the functions IsBlank and Len says the gallery is empty. 

    I tried to use the CountRows function as suggested further up, but then it did not fetch any value for the Variable of "SelectedLocation", meaning Page 3 was filtered wrong.

    I as you can see in the posts above the gallery is populated with text, but the functions says it is empty and I have to a Refresh of the Sharepoint Table for the functions to work and store the right item. But it only works if I have the refreshment statement on another button than the navigation button. 


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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard