web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Apps - Power Query
Suggested answer

Nested gallery

(0) ShareShare
ReportReport
Posted on by 2

Hello everyone,

I am working on a Power Apps application and I need help with the "Save" button formula in the context of a nested gallery. My goal is to save the following information to a SharePoint list: the person's name, the activity, and the type of position selected from a dropdown list.

Here’s a preview of my interface: 

  


 

The data needs to be saved in the SharePoint list, which has the following columns: Date, Collaborator, Activity, and PositionType.

Thank you in advance for your help and advice on how to implement this functionality with a nested gallery!
 
 
 

Best regards,


 

Categories:
I have the same question (0)
  • Suggested answer
    SebS Profile Picture
    4,366 Moderator on at
    Nested gallery
    You could try this just make sure you change name of your data source 

    ForAll(
        gal_Collaborator.AllItems,
        With(
            { varCollaborator: ThisRecord.Collaborator },
            ForAll(
                gal_Activity.AllItems,
                Patch(
                    'SharepointList',
                    Defaults('SharepointList'),
                    {
                        Date: dp_Date.SelectedDate,
                        Collaborateur: varCollaborator,
                        Activité: ThisRecord.ActivityName,
                        TypePoste: drp_Position.Selected.Value
                    }
                )
            )
        )
    );
    Notify("Activities saved successfully!", NotificationType.Success)

    Not best Use of ForAll (Should not use it in big data sets as loop) but should work with Your example :)
  • AN-05111234-0 Profile Picture
    2 on at
    Nested gallery

    Thank you SebS, I tested your formula, but with the double ForAll, the data is not saved. When I keep just the first ForAll, the data is saved, but when I add the second ForAll to access the data from the nested gallery, nothing is saved.

     

    I modified the formula, but still nothing. Do you have any other ideas?

     

       ForAll(
           Gal_Collaborateur.AllItems, 
           With(
               {
                   CollaborateurName: ThisRecord.Personne 
               },
               ForAll(
                   Gal_Activité.AllItems, 
                   Patch(
                       'Suivi des activités',
                       Defaults('Suivi des activités'),
                       {
                           Collaborateur: CollaborateurName, 
                           Activité: ThisRecord.Activité, 
                           TypePoste: ThisRecord.ddl_Valeur.Selected.Value,  
                           Date: Datepicker.SelectedDate 
                       }
                   )
               )
           )
       );

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 686 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 433 Super User 2025 Season 2

#3
wolenberg_ Profile Picture

wolenberg_ 266 Moderator

Last 30 days Overall leaderboard

Featured topics