Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Error Handling
Answered

Nested gallery and a Form

(0) ShareShare
ReportReport
Posted on by 33
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? 
  • Verified answer
    MD-08041325-0 Profile Picture
    33 on at
    Nested gallery and a Form
    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! 
  • MS.Ragavendar Profile Picture
    2,210 on at
    Nested gallery and a Form
     
    I try to replicate the same from my end its working fine. 
     
    Can you please share the screenshot of the error.
  • MD-08041325-0 Profile Picture
    33 on at
    Nested gallery and a Form
    @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 
  • Suggested answer
    MS.Ragavendar Profile Picture
    2,210 on at
    Nested gallery and a Form
     
    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
    33 on at
    Nested gallery and a Form
    @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. 
  • KevinGador Profile Picture
    572 Super User 2025 Season 1 on at
    Nested gallery and a Form
    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
    33 on at
    Nested gallery and a Form
     
    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
    572 Super User 2025 Season 1 on at
    Nested gallery and a Form
    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
    33 on at
    Nested gallery and a Form
    @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
    572 Super User 2025 Season 1 on at
    Nested gallery and a Form
    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! 💻💡



     

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

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics