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 : PdbiWo77MX/vcNq0M0AM3W
Power Apps - Building Power Apps
Answered

Add a user to a Sharepoint column in an existing row

Like (0) ShareShare
ReportReport
Posted on 24 Apr 2023 19:38:03 by 92

Hello,

I'm currently working on a PowerApp to sign up to events. The user selects an event from a Gallery and then presses a button to sign up to the event. The events are stored in a SharePoint list named Veranstaltungen and have their unique ID. The list has a column named Teilnehmer, where the user should be added alongside the existing participants (as user objects).

That's my formula so far, but no matter what I try as the third argument, I always get errors.

 

Patch(Veranstaltungen;LookUp(Veranstaltungen; ID = BrowseGallery.Selected.ID);what_here)

 

Could anyone provide help?

Thanks in Advance

  • Verified answer
    tomjedig Profile Picture
    92 on 26 Apr 2023 at 20:17:24
    Re: Add a user to a Sharepoint column in an existing row

    Hi there,

     

    unfortunately none of the two formulas you provided worked. I found a solution though: I simply made a flow with Power Automate that does this action, and ran it by the press of a button in PowerApps. 🙂

     

    Thanks for your help though! 

  • JohnM86 Profile Picture
    590 on 24 Apr 2023 at 21:43:04
    Re: Add a user to a Sharepoint column in an existing row

    Try with this but change the values to your own:

     

    ClearCollect(collectMultiPersons, Gallery1.Selected.Attendees); //collect current attendees

    Collect(collectMultiPersons, //add this attendee to the collection

    {'@odata.type': "#Microsoft​.Azure.Connectors.SharePoint.SPListExpandedUser",

    Department: "",

    Claims: "i:0#.f|membership|" & User().Email,

    DisplayName: User().FullName,

    Email: User().Email,

    JobTitle: "",

    Picture: ""}); 

     

    Patch(table, Gallery1.Selected, {column: collectMultiPersons})  //overwrite the existing table with your collection

  • JohnM86 Profile Picture
    590 on 24 Apr 2023 at 20:26:42
    Re: Add a user to a Sharepoint column in an existing row
    Patch( Veranstaltungen, LookUp(Veranstaltungen, ID = BrowseGallery.Selected.ID), { Teilnehmer: Value( If( IsBlank( Veranstaltungen[@Teilnehmer] ), { '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & Lower(User().Email), Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"" }, Concatenate( Veranstaltungen[@Teilnehmer], ";", { '@OData.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & Lower(User().Email), Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"" } ) ) ) } )

    In this updated formula, we are using an If statement to check if the "Teilnehmer" column is blank. If it is blank, we set the value to a new user object, just like in the previous formula.

    If the "Teilnehmer" column is not blank, we use the Concatenate function to concatenate the existing values with the new user object using a semicolon as the separator.

    We also use the Value function to convert the result of the If statement to the expected data type of the "Teilnehmer" column, which is a table.

  • tomjedig Profile Picture
    92 on 24 Apr 2023 at 20:21:34
    Re: Add a user to a Sharepoint column in an existing row

    Hi, thanks for your answer. Unfortunately, the formula is not working, it throws five errors (I translated them from German):

     

    - The function "Concatenate" has invalid arguments.

    - Invalid argument type (Table). Instead a Text-value is expected.

    - Invalid argument type (Record). Instead a Text-value is expected.

    - The function "Patch" has invalid arguments.

    - The type of "Teilnehmer" isn't matching the expected type "Table". Found was type "Text".

  • JohnM86 Profile Picture
    590 on 24 Apr 2023 at 19:50:41
    Re: Add a user to a Sharepoint column in an existing row

    Hi @tomjedig 

     

    please try this : 

     

    Patch( Veranstaltungen, LookUp(Veranstaltungen, ID = BrowseGallery.Selected.ID), {Teilnehmer: Concatenate( Veranstaltungen[@Teilnehmer], ";", { '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser", Claims:"i:0#.f|membership|" & Lower(User().Email), Department:"", DisplayName:User().FullName, Email:User().Email, JobTitle:"" } ) } )

     

    In the above formula, we're using the Patch function to update the SharePoint list item corresponding to the selected event. The first argument is the SharePoint list name, and the second argument is the item to be updated, which is identified using the Lookup function.

    The third argument is where we define the columns to be updated and their new values. In this case, we want to update the "Teilnehmer" column, and we're concatenating the existing values of this column (if any) with the new user object that we're adding. We're using the Concatenate function to combine the existing values and the new user object with a semicolon as a separator.

    The new user object is created using the SPListExpandedUser data type, which is a custom data type provided by the SharePoint connector. We're using the User() function to get the current user's email and full name, and we're constructing the Claims value to match the email format that SharePoint expects. If you need to add additional user properties, such as the user's job title, you can add them to the object as well.

    Note that the above formula assumes that the "Teilnehmer" column is a multi-valued column that can store multiple user objects. If the column is a single-valued column, you can replace the Concatenate function with the new user object.

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

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Paul Stork – Community Spotlight

We are honored to recognize Paul Stork as our July 2025 Community…

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 791 Most Valuable Professional

#2
MS.Ragavendar Profile Picture

MS.Ragavendar 410 Super User 2025 Season 2

#3
mmbr1606 Profile Picture

mmbr1606 275 Super User 2025 Season 2