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 / Nested gallery and a Form
Power Apps
Answered

Nested gallery and a Form

(1) ShareShare
ReportReport
Posted on by 40
Hi!
 
I created a nested Gallery with the help of the following video: https://www.youtube.com/watch?v=fghIcy47Jr8&list=LL&index=4
The gallery itself works well, it expands and collapses as it should (formulas the same as in the video, except on the table).
However, instead of a table (as in the video) I tried to have a Form show the information about the item selected in the gallery.
But the form won't show any information of the selected "Modification" when I select this in my Gallery. 
 
Editing:
 
Formulas
Gallery 'ModifcationGallery' connected to table 'Internal research' nested inside 'CategoryGallery' connected to table 'Main group hydrocolloid'
  • Item: Filter('Internal researches'; 'Main group hydrocolloid internal' = HydrocolloidMainGroupTextLabel.Text)
  • Onselect: 
    UpdateContext({ itemSelected: true; CurrentItem: ThisItem })
Form
  • Source: 'Internal research'
  • DefaultMode: 
    If(newMode; FormMode.New; editMode; FormMode.Edit; FormMode.View)
  • Item: 
    ModificationGallery.Selected
 
 
Example of the app: 
"No items to display" 
 
Can anyone shed some light on how to solve this or whether this is just an error happening? 
Categories:
I have the same question (0)
  • KevinGador Profile Picture
    832 Moderator on at
    honestly I did not get what you meant by connecting it to a form but I assume you connected a gallery and when it is clicked it will show the details in the form.

    1) are you using an edit form or a view form? 

    2) Check the default mode of the form if it is in "View", "Edit" or "New"

    3) Double check the datasource of the form as well.

    4)Show us your codes in the form and the gallery to better help you with your situation.

    This might be similar to your problem: Solved: No item to display check out the verified answer
    ------
    If this solves your problem, don't forget to mark it as the answer and give it a like! 😊 Your feedback helps others in the community. Thank you and happy learning power apps! 💻💡



     
  • MD-08041325-0 Profile Picture
    40 on at
    @KevinGador thank you for your reply! I tried to answer your questions below
     
    1) I honestly don't know anymore. I used a formula for DefaultMode which I copied from another form that was automatically created (as nothing would show up when I had another defaultmode)
     
    2) Same answer as above
     
    3) DataSource is the right one. When I create a table, it shows the information using the same datasource
     
    4) I added my codes to the post under the first picture. Hope this helps, otherwise please let me know :)
     
    5) I looked at the other thread. When I change it to FormMode.New, as suggested, I can edit and at least see the something on the screen but it won't show the existing information. If I change it to View or Edit, it gives the same problem "no items to show"
  • KevinGador Profile Picture
    832 Moderator on at
    Hi ,

    1) Hi the difference between an edit form and a display form is that an edit form you have the property called default mode which has view, new and edit while the disply form doesnt and just makes you view details, since you have a default mode property mentioned, it is an edit form I normally wouldnt suggest using a display form as its not flexible.

    2)   in your formula 
     
    ​​​​​​​If(newMode; FormMode.New; editMode; FormMode.Edit; FormMode.View)

    you have a wrong formula here, you can see that you are using  ; (semi colons) instead of a comma 

    the correct syntax of an If statement in powerapps is 
     
    
    If(Condition1, Result1, Condition2, Result2, ..., DefaultResult)
    


    try changing your DefaultMode formula to 
     
    If(
        newMode, FormMode.New,
        editMode, FormMode.Edit,
        FormMode.View
    )
    

    ---- 
    ​​​​​​​If this solves your problem, don't forget to mark it as the answer and give it a like! 😊 Your feedback helps others in the community. Thank you and happy learning power apps! 💻💡
  • MD-08041325-0 Profile Picture
    40 on at
     
    Thanks for taking the time again!
     
    Okay, good to know. I didn't know you have these types of forms. Good that I (accidentally) chose the right form. 
     
    Regarding the semicolon, I'm using a Dutch version in which the ; and , are switched around ;) it is very confusing, I know, but I can't change it unfortunately so I'm used to by now. 
     
    Any other ideas what could a hindrance? 
  • KevinGador Profile Picture
    832 Moderator on at
    okay I ddn't know about that dutch thing with the semi colon. 

    another set of questions: 

    I would like to know the declaration and usage of the variable newMode and editMode.



     " I looked at the other thread. When I change it to FormMode.New, as suggested, I can edit and at least see the something on the screen but it won't show the existing information. If I change it to View or Edit, it gives the same problem "no items to show"

    In this answer you gave me I'm quite confused, FormMode.New is supposed to let you enter new records not see the information or edit the existing record, could you clarify this part? is the editMode or newMode showing the "no items to display" message?

    also have you tried debugging? I would suggest you create a button and then on the onselect property of this button put NewForm(yourFormName) similar to this video so we could check if it would still show "no items to display" : 
    NO ITEM TO DISPLAY message on Power Apps Forms when creating a new register. Blank app form screen.
  • MD-08041325-0 Profile Picture
    40 on at
    @KevinGador to answer your questions:
     
    In this answer you gave me I'm quite confused, FormMode.New is supposed to let you enter new records not see the information or edit the existing record, could you clarify this part? is the editMode or newMode showing the "no items to display" message?
    The EditMode and ViewMode are both showing me the "no items to display" message, but the newMode works. What I meant is that all the textboxes are suddenly showing up (to fill in), no "no items to display" message anymore

    also have you tried debugging? I would suggest you create a button and then on the onselect property of this button put NewForm(yourFormName) similar to this video so we could check if it would still show "no items to display" : 
    NO ITEM TO DISPLAY message on Power Apps Forms when creating a new register. Blank app form screen.
    Yes, I already have a + New button on the left above the gallery. When I click that, I can create a new record and all the textboxes are showing.
     
    Edit/View mode
    versus
     
    New mode
     
     
    What is interesting is that one of the datacards comes from a column that is a lookup column. At first, that one didn't work and only showed "item 1, item 2" and gave an error. Now, I added the "main group hydrocolloid internal" datacard (Datacard/column is now optional, but takes some time to load that in the app) and the "combobox datacard" suddenly works, even if I remove the Main group hydrocolloid internal datacard. 
     
    Unfortunately, the "no items to display" message is still  showing in the edit and view mode. 
  • Suggested answer
    MS.Ragavendar Profile Picture
    6,334 Super User 2026 Season 1 on at
     
    In the gallery, I added one Icon (Icon.Edit).
     
    On Select Property of the Icon 
     
    Set(varselectedItem,ThisItem);
    EditForm(Form1);
     
    // In the same screen itself i have used the form control, if you are using the separate screen u need to use the navigate function as well.
     
     
     
    Edit Form Control - Add the respective fields accordingly.
     
     
    DataSource - ur sharepoint list  (in my case its novice)
     
     
    Item Property - varselectedItem 
     
    // This is variable i am using it 
     
     
     
    Save button 
     
     
    If you have further queries 
    🏷️ Please tag me @MS.Ragavendar if you still have any queries related to the solution or issue persists.
     
    If issue resolved
    Please click Accept as solution if my post helped you solve your issue and help others who will face the similar issue in future.
     
    ❤️ Please consider giving it a Like, If the approach was useful in other ways.
  • MD-08041325-0 Profile Picture
    40 on at
    @MS.Ragavendar thank you for your reply.
     
    I also have an icon that has the same function as you explained here (to edit your form). I approached it differently, or actually PowerApps did when the app was automatically created. 
     
    This formula I'm using for the onselect function: 
    UpdateContext({ editMode: true; selectedRecord: RecordsGallery1.Selected })
     
     
    I tried your approach. The ThisItem part of the first formula gives me an error.
    And I think because this gives an error, the Item property of the form "varSelectedItem" also isn't recognised 
  • MS.Ragavendar Profile Picture
    6,334 Super User 2026 Season 1 on at
     
    I try to replicate the same from my end its working fine. 
     
    Can you please share the screenshot of the error.
  • Verified answer
    MD-08041325-0 Profile Picture
    40 on at
    I solved the problem and now it works. At first it started showing my records when I changed the Fill of the TextLabel in the nested Gallery to 
    If(ThisItem.Modification = ModificationGallery.Selected.Modification;
    RGBA(166; 215; 153; 1); RGBA(0; 0; 0; 0))
     
    For some reason, this was the trigger. But then, it didn't show the right records in the Form. It didn't show the information of the subcategories when clicked on, it just showed the first one and didn't change upon selecting. 
     
    To fix that I did the following:
     
    First, I changed the OnSelect property of the Nested gallery to 
    UpdateContext({ locSelectedModification: ThisItem})
     
    Where locSelectedModification is a context variable (Record)
     
    Then I changed the Item property of my Form to: locSelectedModification
     
    Now it works perfectly! 
     
     
    @MS.Ragavendar @KevinGador thank you for trying to help me solve this and all your suggestions! 

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 March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 536

#2
WarrenBelz Profile Picture

WarrenBelz 426 Most Valuable Professional

#3
Haque Profile Picture

Haque 305

Last 30 days Overall leaderboard