How to add users to a group column through PowerApps to SharePoint List.

Ayden Franklin 40 Reputation points
2024-06-20T18:35:29.72+00:00

I am making a Ride Sharing App were users can schedule (create), join, and leave rides. Information regarding each scheduled ride is stored in a SharePoint list. Each record has a Members column which stores all users who have joined that particular ride. When a user joins, I need to update the current Table of users by adding the current user. I have attached my solution as of now.

I am getting two errors: 'Invalid Argument Type. Expected Table value, but of different schema.' and 'Missing column. Your formula is missing a column Claims of type Text.' I am not sure the proper solution.

I found my current solution here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Add-Person-to-the-Multi-Select-Person-Column-in-Sharepoint-from/td-p/2246551

Patch(
    RideShareRevert,
    RideGallery.Selected,
    {
        Members: Ungroup(
            Table(
                {
                    Items: RideGallery.Selected.Members
                },
                {
                    Items: [
                        {
                            Claims: "i:0#.f|membership|"&Lower(User().Email),
                            DisplayName: "",
                            Email: User().Email,
                            JobTitle: "",
                            Picture: ""
                        }
                    ]
                }
            ),
            "Items"
        )
    }
)
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,249 questions
{count} votes

Accepted answer
  1. Yanli Jiang - MSFT 23,886 Reputation points Microsoft Vendor
    2024-07-02T01:25:19.2333333+00:00

    Hi @Ayden Franklin ,

    Great to know that and thanks for sharing the update here.

    By the way, since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others.". and according to the scenario introduced here: Answering your own questions on Microsoft Q&A, I would make a brief summary of this thread:

    [How to add users to a group column through PowerApps to SharePoint List.]

    Issue Symptom:

    I am making a Ride Sharing App were users can schedule (create), join, and leave rides. Information regarding each scheduled ride is stored in a SharePoint list. Each record has a Members column which stores all users who have joined that particular ride. When a user joins, I need to update the current Table of users by adding the current user. I have attached my solution as of now.

    I am getting two errors: 'Invalid Argument Type. Expected Table value, but of different schema.' and 'Missing column. Your formula is missing a column Claims of type Text.' I am not sure the proper solution.

    I found my current solution here: https://powerusers.microsoft.com/t5/Building-Power-Apps/Add-Person-to-the-Multi-Select-Person-Column-in-Sharepoint-from/td-p/2246551

    Patch(
        RideShareRevert,
        RideGallery.Selected,
        {
            Members: Ungroup(
                Table(
                    {
                        Items: RideGallery.Selected.Members
                    },
                    {
                        Items: [
                            {
                                Claims: "i:0#.f|membership|"&Lower(User().Email),
                                DisplayName: "",
                                Email: User().Email,
                                JobTitle: "",
                                Picture: ""
                            }
                        ]
                    }
                ),
                "Items"
            )
        }
    )
    

    Current status:

    I added Department: "" to the user object and it worked.

    You could click the "Accept Answer" button for this summary to close this thread, and this can make it easier for other community members to see the useful information when reading this thread. Thanks for your understanding!

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Yanli Jiang - MSFT 23,886 Reputation points Microsoft Vendor
    2024-06-21T02:22:05.45+00:00

    Hi @Ayden Franklin ,

    According to your description, this cannot be achieved directly in SharePoint and is more related to Power Apps. As a SharePoint engineer, I am not good at Power Apps. And unfortunately, Power Apps is currently not supported in the Q&A forum. In order to better solve the issue, we suggest you start a new discussion via the Power Apps Community so that you can get dedicated support on this issue.

    Thanks for your understanding!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.