Hi Everyone,
I am trying to achieve patching data multiple times based on a value from either a textinput or a slider etc. '
Essentially i have a button that will patch a string to a SP list that looks like this:
Patch('Gusets Friday';Defaults('Guests Friday');{Title:"Guest"})
This patches the string "Guest" to the title of the SharePoint List in question(Guests Friday). However what i want to achieve is to enable people to add multiple guests to the list from the app.
What i was thinking was to maybe implement a slider where people could set the value of this to how ever many guests they want to add, i tried this and tried to play with it in order to make i work. The end goal would be for it to patch "Guest" twice in to the list as two seperate fields, not as the number "2" 🙂
What i tried looked like this
Patch('Gæster Fredag', Defaults('Gæster Fredag') , {Title:"Gæst" * slider.value})
However this does not work, which i did not really expect it to either, however i am drawing a bit of a blind here, anyone know of a smart way to achieve this? 🙂
- Tobi
Solved! Go to Solution.
@Anonymous
Lets' do a mini-tutorial as an example. My example will be simple compared to yours but it will illustrate the technique you must use.
Step #1: Setup a new screen that looks like this
Step #2: Put the following code in the OnSelect property of the plus sign icon
Step #3: Put this code in the following properties for txt_guestName
Default: "" Reset: resetTxtInput
Step #4 Create a gallery based on the guestsInvited collection that looks like this
Step #5: Add the following code to your submit button. A new line will be inserted into the Sharepoint list for each guest.
ForAll( guestsInvited; Patch( 'Guests Friday'; Defaults('Guests Friday'); {Title: guestsInvited[@guestName]} ) )
Of course, we should add more features to this interface (remove a guest, remove all guests, clear the collection after submission) but this was just a simple tutorial.
Let me know what questions you have.
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
@Anonymous
Do you want a new record to be created in the Sharepoint list for each guest? Or a single line for all guests in a single submission?
@Anonymous
I suppose I should ask one more question: are these guests found in the active directory (are they searchable by people picker) or do they include people outside the company?
@mdevaney
No these can not be found in the active directory, these are exclusively people from outside the company 🙂
@Anonymous
Lets' do a mini-tutorial as an example. My example will be simple compared to yours but it will illustrate the technique you must use.
Step #1: Setup a new screen that looks like this
Step #2: Put the following code in the OnSelect property of the plus sign icon
Step #3: Put this code in the following properties for txt_guestName
Default: "" Reset: resetTxtInput
Step #4 Create a gallery based on the guestsInvited collection that looks like this
Step #5: Add the following code to your submit button. A new line will be inserted into the Sharepoint list for each guest.
ForAll( guestsInvited; Patch( 'Guests Friday'; Defaults('Guests Friday'); {Title: guestsInvited[@guestName]} ) )
Of course, we should add more features to this interface (remove a guest, remove all guests, clear the collection after submission) but this was just a simple tutorial.
Let me know what questions you have.
---
Please click "Accept as Solution" if my response helped to solve your issue so that others may find it more quickly. If your thought the post was helpful please give it a "Thumbs Up."
@mdevaney
That makes good sense, thanks very much, the other features of Removing a guest, clearing submissions, etc. I think can figure that out, otherwise i wil let you know 🙂
Thanks again 🙂
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
271 | |
254 | |
87 | |
39 | |
34 |
User | Count |
---|---|
349 | |
262 | |
130 | |
68 | |
48 |