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 / Save the Gallery's cho...
Power Apps
Unanswered

Save the Gallery's choise for another page

(0) ShareShare
ReportReport
Posted on by 120

Hi all!

 

I have a Power Apps Canvas app with several pages. On page1 I have a Gallery1. The formula for the Gallery's Items is:

Sort(
 Filter('Modul-Expert_demo', Expert.Experts_demo = '1_Expert_Dropdown'.Selected.Experts_demo),
 Modul_Number,
 Ascending
)

In this Gallery I display information in Label. The formula for the Label's Text is:

LookUp(Modules_demo, cr7d9_modules_demoid=ThisItem.Modul.Modules_demo,Modul)

 

On the page2 I have similar Gallery (with the same formulas) and a Button.

When I press the Button I move to the page1. OnSelect formula is:

Navigate(
 '3 NewForm_Scr',
 ScreenTransition.Fade, 
 {MemberForEdit: '4_Member_Dropdown'.Selected.Member, 
 ModulForEdit: '4_ProfModules_Gallery'.Selected.'4_Title_Module'}
)

I want to save the choice from the Gallery on the page2 and when I move to the page1 I would like to see this choice in the Gallery1. I try to use for this variable "ModulForEdit" and set up in as Default for Gallery1. But it doesn't work.

 

Could you please help me to find a solution?

 

Thanks!

 

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @KCh ,

    Could you please share a bit more about your scenario?

    Do you want to pass the selected value from your Page2 back to Page1 when you click the Button?

    Further, which column do you use to compare with the passed variable value (MemberForEdit & ModulForEdit)?

     

    Based on the formula that you mentioned, I think there is something wrong with it. Please consider modify your Navigate formula as below:

    Navigate(
     '3 NewForm_Scr',
     ScreenTransition.Fade, 
     {
     MemberForEdit: '4_Member_Dropdown'.Selected.Member, 
     ModulForEdit: '4_ProfModules_Gallery'.Selected // Modify formula here
     }
    )

     

    Set the Default property of the Gallery1 to following:

    If(
     !IsBlank(ModulForEdit),
     ModulForEdit
    )

    Set the TemplateFill property of the Gallery1 to following (highlight the selected item in the Gallery1😞

    If(ThisItem.IsSelected,RGBA( 95, 158, 160, 1 ),RGBA(0, 0, 0, 0))

    Note: I assume that the Gallery1 and Gallery2's Items proeprty have same Sort formula as you mentioned.

     

    Best regards,

  • KCh Profile Picture
    120 on at

    Hi, @v-xida-msft !

    Thank you for your reply!

     

    It is true - I have a problem with the last part of the formula "Navigate" on the page2. In this part: ModulForEdit: '4_ProfModules_Gallery'.Selected. //I can't understand what I should put here.

     

    I think it is because the complex value that I show in this Gallery. I should try to explain.

    I have 3 Entities in Common Data Model:

    1) 'Modules_demo' - the list of all modules in my App

    2) 'Experts_demo' - the list of all Experts in my App

    3) 'Modul-Expert_demo' - the list of Modules with assign Expert for each Modul.

     

    In my App I choose the Expert (in the page before Page1 in my example). This choice have impact on the list of Modules that show in Gallery on the Page1 - I show only modules that assigned to the selected Expert.

    So the formula for the Gallery is:

    Items = 
    Sort(
     Filter('Modul-Expert_demo', cr7d9_Expert.Experts_demo = '1_Expert_Dropdown'.Selected.Experts_demo),
     cr7d9_modul_number,
     Ascending
    )

    When I use only this formula I see Identificators in my Gallery. That's why I have a formule for the 'Text" in this Gallery:

    Text =
    LookUp(Modules_demo, cr7d9_modules_demoid=ThisItem.Modul.Modules_demo,Modul)

    This formula allows me to see the name of Modules instead their ID.

     

    I think because of this I have a trouble to find a solution what should I put in the formula that you mentioned.

     

    When I try to put formula as I mentioned in my 1st post and put the formula in "Default" that you mentioned - I have an error in the Gallery1: "Invalid formula. Expected a value compatible with 'Items'."

     

    PS Yes, Gallery1 and Gallery2 have the same properties.

  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @KCh ,

    Is the Items property of Gallery1 and Gallery2 set to same Filter formula?

     

    Please set the OnSelect property of the "Navigate" button in your Page2 to following:

    Navigate(
     '3 NewForm_Scr',
     ScreenTransition.Fade, 
     {MemberForEdit: '4_Member_Dropdown'.Selected.Member, 
     ModulForEdit: '4_ProfModules_Gallery'.Selected.'4_Title_Module'.Text}
    )

     

    Set the Default property of the Gallery1 to following:

    LookUp(
     Filter('Modul-Expert_demo', cr7d9_Expert.Experts_demo = '1_Expert_Dropdown'.Selected.Experts_demo),
     LookUp(Modules_demo, cr7d9_modules_demoid = Modul.Modules_demo).Modul = ModulForEdit
    )

    Please consider take a try with above solution, check if the issue is solved.

    Note: I assume that the '4_Title_Module' represents a Label control within the Gallery2 in your Page2, which display the Module name.

     

    Best regards,

  • KCh Profile Picture
    120 on at

    @v-xida-msft wrote:

    Is the Items property of Gallery1 and Gallery2 set to same Filter formula?


    Yes.

     


    @v-xida-msft wrote:

    Note: I assume that the '4_Title_Module' represents a Label control within the Gallery2 in your Page2, which display the Module name.


    Yes, that's right.

     

    I've updated OnSelect and Default properties with formulas that you mentioned. But that doesn't work. I don't have an arrer now, but when I go from Page2 to Page1 the Gallery on the Page1 doesn't select the Modul that was selected on the Page2.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 1,074

#2
Valantis Profile Picture

Valantis 639

#3
11manish Profile Picture

11manish 606

Last 30 days Overall leaderboard