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 / Navigate to Gallery wh...
Power Apps
Unanswered

Navigate to Gallery when Item no longer viewable

(1) ShareShare
ReportReport
Posted on by 181

Hi all.


My gallery is filtered to only show items which have a status.value of "Active"

 

When I edit an item, the SubmitForm is set NOT to navigate away from the form page, however, if I set the status of an item to "Inactive", because this is now hidden in my gallery, I get a blank screen with 'Getting your data ...'

Angry_Sys_Admin_0-1690831012208.png

 

Is it possible to set the submit form to remain on the page if there is data or to navigate back to the gallery page when data is no longer available?

 

Many thanks

Categories:
I have the same question (0)
  • narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at

    @Angry_Sys_Admin 

     

    If your gallery is connected to datasource, the list refreshes when you submit the form. And the form cannot display anything as the referenced id for the form doesn't exist in the gallery anymore.

     

    You can use if condition to check if the item exist in the gallery and navigate based on that condition.

    SubmitForm(editForm);If(Gallery4_1.Selected.ID = Blank(),Navigate(Screen1));

    This runs after submitting the form and navigates to screen1 if the item doesn't exist in the gallery anymore.

     

    Hope this makes sense.

     

    Cheers!

  • Angry_Sys_Admin Profile Picture
    181 on at

    @narayan225 Thank you for your reply.

     

    I have implemented this but still will not navigate away from the screen when the ID no longer exists:

     

    SubmitForm(UserGalForm); If(UserGal.Selected.ID = Blank(),Navigate(HomeScreen));
  • narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at

    @Angry_Sys_Admin 

     

    I realise that you don't actually need to compare the id to blank. Can you try updating the formula to following.

    SubmitForm(UserGalForm); If(UserGal.Selected.ID,Navigate(HomeScreen));

     

    Hope this helps.

     

    Cheers!

  • Angry_Sys_Admin Profile Picture
    181 on at

    @narayan225 I updated the formula.


    This now navigates away form the record regardless if the record is still visible in the gallery.


    I need it to work so, if im just updating the record, which remains visible on the gallery, after form submission we remain on the edit form page.

     

    If I am, for example, closing a task which, once closed is filtered from the gallery, I need it to navigate back to the home screen on form submission 

  • narayan225 Profile Picture
    2,547 Super User 2025 Season 2 on at

    @Angry_Sys_Admin 

     

    You can use the following formula for that one.

    SubmitForm(UserGalForm); If(Not(UserGal.Selected.ID),Navigate(HomeScreen));
    //If the item is not there in gallery, it will navigate to HomeScreen

    If the item is still in gallery, it will stay in the same page.

     

    Hope this helps.

     

    Cheers!

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard