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 / Exporting Gallery Data...
Power Apps
Unanswered

Exporting Gallery Data to Sharepoint - "Person" Column

(1) ShareShare
ReportReport
Posted on by 15
Hi Community Members, 

I am trying to make a Power App based Homepage.
I would want this homepage to link to some basic reports BI reports. 
I also want the option for users to add their own favorite reports besides the main reportset. 

Therefor I made a menu linked to a gallery, that has a menupoint to add a report available for the user to the favorits, and a separate menupoint for removal



In the Gallery of the app, users can select to add an element to their favorites.
If they select an item in the gallery, a popup will show up.


If they click yes to this "Button1", I want the selected item to be exported to a SharePoint list called "User Dataset" .
Specifically in a Collumn called "UserFavorite_DS", and for that specific user. 

I have 2 Connectors in the app an Office365Users Connector and a Sharepoint connector to "User Data" .
Have been trying to make it work, but wasnt able to.
Could I kindly ask for the community for help ? 

I Have attached an example of my test dataset. 
Please note that the UserFavorite_DS column in the SharePoint List is a "Person" Column type.
(Attila Liebmann already has some favorites, but this is only why I wanted to test some things so I added it manually in the list.)



I was experimenting with this formula, but I might be not on the right track : 

 
// Get the current user's details using Office365Users connector
Set(currentUser,
    {
        DisplayName: User().FullName,
        Email: User().Email,
        UserPrincipalName: Office365Users.UserProfileV2(User().Email).userPrincipalName
    }
);
 
// Add or update the selected item in the SharePoint list
Patch(
    'User Dataset',  // Replace with your exact SharePoint list name if different
    LookUp(
        'User Dataset',
        Mail_DS = User().Email &&
        Bericht_DS = ThisRecord.Bericht_DS
    ),  // Find the item to update based on unique fields
    {
        UserFavorite_DS: {
            Claims: "i:0#.f|membership|" & Lower(currentUser.UserPrincipalName),
            DisplayName: currentUser.UserPrincipalName,
            Email: currentUser.Email
        }
    }
);


Please help! 
Thank you in advance
Categories:
I have the same question (0)
  • Verified answer
    mmbr1606 Profile Picture
    14,567 Super User 2025 Season 2 on at
    hey
     
     
    can u try this approach:
    Set(currentUser,
        {
            DisplayName: User().FullName,
            Email: User().Email,
            UserPrincipalName: Office365Users.UserProfileV2(User().Email).userPrincipalName
        }
    );
    
    If(
        IsBlank(
            LookUp(
                'User Dataset',
                Mail_DS = currentUser.Email &&
                Bericht_DS = ThisRecord.Bericht_DS
            )
        ),
        Collect(
            'User Dataset',
            {
                Mail_DS: currentUser.Email,
                Bericht_DS: ThisRecord.Bericht_DS,
                UserFavorite_DS: {
                    Claims: "i:0#.f|membership|" & Lower(currentUser.UserPrincipalName),
                    DisplayName: currentUser.DisplayName,
                    Email: currentUser.Email
                }
            }
        ),
        Patch(
            'User Dataset',
            LookUp(
                'User Dataset',
                Mail_DS = currentUser.Email &&
                Bericht_DS = ThisRecord.Bericht_DS
            ),
            {
                UserFavorite_DS: {
                    Claims: "i:0#.f|membership|" & Lower(currentUser.UserPrincipalName),
                    DisplayName: currentUser.DisplayName,
                    Email: currentUser.Email
                }
            }
        )
    );
    
    
    button onselect:
    Set(
        confirmationVisible,
        true
    );
    
    if my answer helped please mark as verified sanswer,
     
     
    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 759 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 310 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 228

Last 30 days Overall leaderboard