cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
TCH
Level: Powered On

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
Super User
Super User

Re: Patch multiple times

@TCH 

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
Super User

Re: Patch multiple times

@TCH 

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?

TCH
Level: Powered On

Re: Patch multiple times

@mdevaney 

A new record for each 🙂 

Super User
Super User

Re: Patch multiple times

@TCH 

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?

 

 

TCH
Level: Powered On

Re: Patch multiple times

@mdevaney   

No these can not be found in the active directory, these are exclusively people from outside the company 🙂 


Super User
Super User

Re: Patch multiple times

@TCH 

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

TCH
Level: Powered On

Re: Patch multiple times

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

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,575)