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

Patch all items in a filtered Gallery

Hello,

 

Im struggling to work out a solution to patch all items in a filtered gallery.

this is what i use to patch a single record 

 

Patch(studenttrackermaster2,ThisItem,{Comments:TextInput1_2.Text},{maths_WorkCompletion:Dropdown2_2.SelectedText},{maths_engagement:Dropdown2_8.SelectedText})

I have attached an image for example
my unique field for each = "UPN"


 
 

 

 

 

 

 

 

14 REPLIES 14

Hi @marc2510 ,

Firstly, the ForAll with the reference to the UPN should do this, so there is something wrong in either the reference match or the values you are patching. I have assumed (from your posts) that the both the Gallery and studenttrackermaster2 have fields called UPN.

Firstly get rid of .SelectedText and replace with (I assume they are Choice columns) with .Selected.Value

Next what are the Items of your Gallery and what are the names of the fields (in the list) that your two drop-downs and text box are linked to?

Yes the gallery and data source have the the UPN data

upn.PNG

When I change from .SelectedText to Select.Value (which I assumed it should be because of the choice field from SP.  I get the following error.
value.PNGerror.PNG


@marc2510 ,

Firstly, I keep seeing different fields in the Patch - I assume that they are all of the same field type. What type are these (I hope Choice) - if so are they single or Multi-choice? If a Single Choice

ForAll(
   Gallery1_1.AllItems As aFiltered,
   Patch(
      studenttrackermaster2,
      {UPN: aFiltered.UPN},
      {
         Comments: TextInput1_1.Text,
         Eng_WorkCompletion: {Value:Dropdown2_1.Selected.Value},
         Eng_engagement: {Value:Dropdown2_7.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.

Hi @marc2510 ,

After our discussion and your renamed controls

ForAll(
   RenameColumns( 
      Gallery1.AllItems,
      "ID",
      "ID1"
   ),
   Patch(
      studenttrackermaster2,
      {ID: ID1},
      {Comments: TextComments.Text},
      {Art_WorkCompletion: {Value: ddCompletion.Selected.Value}},
      {Art_engagement: {Value: ddEngagment.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.

View solution in original post

Perfect!

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

PA Community Call

Power Apps Community Call

Next call is happening on April 21st at 8a PST.

MBAS Carousel

Sign up for our May 4th event!

May the fourth be with you, join us online!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors
Users online (35,073)