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
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!
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
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.
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".
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.
WarrenBelz
791
Most Valuable Professional
MS.Ragavendar
410
Super User 2025 Season 2
mmbr1606
275
Super User 2025 Season 2