cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Patch multiple times

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 

1 ACCEPTED SOLUTION

Accepted Solutions

@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

 

img10.png

 

Step #2:  Put the following code in the OnSelect property of the plus sign icon

 

img11.png

 

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

 

img12.png

 

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."

View solution in original post

6 REPLIES 6
Super User III
Super User III

@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
Not applicable

@mdevaney 

A new record for each 🙂 

Super User III
Super User III

@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?

 

 

Anonymous
Not applicable

@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

 

img10.png

 

Step #2:  Put the following code in the OnSelect property of the plus sign icon

 

img11.png

 

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

 

img12.png

 

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."

View solution in original post

Anonymous
Not applicable

@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 🙂 


Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Solution Authors
Top Kudoed Authors
Users online (32,395)