cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper II
Helper II

How to select multiple items from a gallery to edit in form with same value?

Hi,

 

I have a gallery and an edit form. I can select 1 item from the gallery to edit in the form. 

 

I want to be able to select multiple items in the gallery to edit in the form with the same value for all items selected in the gallery. I basically want to set multiple items to the same value in a Sharepoint list field. 

 

How can I do that?

 
Thanks.
 
2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User III
Super User III

Hi @andygp25 

 

Thanks for the screen share. 

 

This is what we did to find the solution.

 

1. Filter the selected items.

2. Apply the Patch for the matching id's (Selected check box)

 

See below.

 

ForAll(RenameColumns(Filter(Gallery2.AllItems,Checkbox1.Value=true),"ID","ID1"),Patch('Travel Requests List',LookUp ('Travel Requests List',ID=ID1),{Travel_x0020_Status:Radio1.SelectedText}))

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Hi @andygp25 ,

Not sure how you involved @abm in this.

Have you tried my suggestion? I spent considerable time putting together a working model to assist you.

I am also probably in a different timezone to you - 9:00am here in Australia.

As you can see below, the latest code works as per your specifications.CheckCount2.gif

View solution in original post

10 REPLIES 10
Super User III
Super User III

Hi @andygp25 ,

Firstly a form can only display one item at a time, so you would have to pick one to display.

One idea would be to look at an editable gallery function - here is a good video from Paul O'Flaherty explaining the process.

You could then update the ones you want.

Another way, probably following your description would be to have a selection box in the gallery items, open one then do an UpdateIf function to set the fields of the selected items to the value of the controls in the form.

Please have a look/read of these - happy to help with the code when you have had a go at it.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

How would I do the check and update function?

OK @andygp25 ,

I don't know what stage you are in your PowerApps journey, but it is very important that you understand the process I am showing below to be able to adapt it to your needs. If you cannot adapt this, the editable gallery I mentioned may also be an option.
The gallery on the left is simply based on a list with a couple of fields (Text and Number type) that currently have not data in them. I used one of each to show the format required. The check boxes are inserted into the gallery and are not connected to any data field. All the the field, list and control names where I have used My at the start will need to changed to your items. Firstly the Submit button you see has the following code

ForAll(
    RenameColumns(
      Filter(
         MyGalleryName.AllItems,
         MyCheckboxName.Value = true
        ),
        "ID",
        "IDRef"
    ),
    UpdateIf(
        MyListName,
        ID = IDRef,
        {
            MyTextFieldName: MyTextControlName.Text,
            MyNumberFieldName: Value(MyNumberControlName.Text)
        }
    )
)

I assume you are using SharePoint and will have a unique ID number to work with. When working, it looks like thisGalleryUpdate.gif

 

 

 

One thing to note is that the input fields do not need to be on a form - you can have them as standalone items on the screen and this will work exactly the same.

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

thank you so much. 

 

How would I do this if on the right I have a Radio button with 3 items showing horizontally?

How can I change a field base on a radio button value? checkbox.PNG

If the checkbox is selected

Hi @andygp25 ,

Generally MyRadioButtonName.Selected.Value would need to be sent to the list if the Items for this is a Choice field or Choice list. A bit more condensed code below.

ForAll(
    RenameColumns(
        Filter(
            MyGalleryName.AllItems,
            MyCheckboxName.Value = true
        ),
        "ID",
        "IDRef"
    ),
    UpdateIf(
        MyListName,
        ID = IDRef,
        {MyListFieldName: MyRadioName.Selected.Value}
    )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Super User III
Super User III

Hi @andygp25 

 

Thanks for the screen share. 

 

This is what we did to find the solution.

 

1. Filter the selected items.

2. Apply the Patch for the matching id's (Selected check box)

 

See below.

 

ForAll(RenameColumns(Filter(Gallery2.AllItems,Checkbox1.Value=true),"ID","ID1"),Patch('Travel Requests List',LookUp ('Travel Requests List',ID=ID1),{Travel_x0020_Status:Radio1.SelectedText}))

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!

Learn more from my blog

Power Automate Video Tutorials

View solution in original post

Hi @andygp25 ,

Not sure how you involved @abm in this.

Have you tried my suggestion? I spent considerable time putting together a working model to assist you.

I am also probably in a different timezone to you - 9:00am here in Australia.

As you can see below, the latest code works as per your specifications.CheckCount2.gif

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

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

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (74,367)