cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Kudo Collector
Kudo Collector

Update All Records in Collection

Hi  - I am having an issue with my statement below. I am trying to have ALL the items in my gallery updated if the Change ID value is = 1. Thoughts on where I may be missing something?

 

UpdateIf(
SPDWIPPlanning,
changeID.Text = Text(1),
{
'Request Status': Dropdown1.Selected.Value,
Production_x0020_Week: Dropdown1_1.Selected.Result,
MenashaSite: Dropdown1_2.Selected.Value,
Cases_x0020_Short: TextInput2_1.Text,
Multiple_x0020_DU_x0020_Ind: Dropdown1_3.Selected.Value
}
)

15 REPLIES 15
Highlighted
Super User III
Super User III

Re: Update All Records in Collection

Hi @tlevine ,

I assume you are getting no result from this rather then seeing an error in your syntax.

It might be a long shot, but have you tried changeID.Text = "1" or changeID = 1

 

Highlighted
Kudo Collector
Kudo Collector

Re: Update All Records in Collection

hi - thanks for the quick reply. unfortunately, this leads to an invalid argument error

Highlighted
Super User III
Super User III

Re: Update All Records in Collection

I see nothing wrong with the syntax.

Have you tried a ForAll with a Patch?

Highlighted
Kudo Collector
Kudo Collector

Re: Update All Records in Collection

to be honest, i can't get the for all to work either which is why i tried to do an updateIf. how could i adjust my syntax to utilize for all? thank for your help in advance!

Highlighted
Super User III
Super User III

Re: Update All Records in Collection

@tlevine 

I got your note on Twitter to come take a look at your Collections issue.  Between @WarrenBelz, yourself and myself I'm sure we can figure this out 🙂

 

Can you please try these two tests to detect where the problem is?

 

#1  Put this code in a label.  Let me know the result

changeID.Text = Text(1)

 

#2  Put this code in a label.  Let me know the result

Value(changeID.Text) = 1

 

 

#3 Does changing the value to true update all records in the collection?

 

UpdateIf(
SPDWIPPlanning,
true,
{
'Request Status': Dropdown1.Selected.Value,
Production_x0020_Week: Dropdown1_1.Selected.Result,
MenashaSite: Dropdown1_2.Selected.Value,
Cases_x0020_Short: TextInput2_1.Text,
Multiple_x0020_DU_x0020_Ind: Dropdown1_3.Selected.Value
}
)

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Kudo Collector
Kudo Collector

Re: Update All Records in Collection

Thanks for the Reply @mdevaney ! 

 

Both of the tests yield the value of true in the label.

 

When I updated my statement to reflect what you shared below, it has updated ALL the records to have the same value. The reason I was trying to use a Change ID (or something along those lines) is to only have the records updated that have a new change made to them before saving. 

 

Looking forward to working through the solution with you guys!

 

 

Highlighted
Super User III
Super User III

Re: Update All Records in Collection

@tlevine 

Well, the good news is there appears to be no syntax problems with your statement.  That was basically the purpose of all those tests.

 

What is your gallery name?  I don't see any references to it within your code?  It appears you are making a reference to SPDWIPPlanning but that must be a datasource.  changeID.Text does not have any relationship to SPDWIPPlanning so that might be why your code is misfiring.

 

Can you please supply a screenshot and answer my questions below?

 

UpdateIf(
SPDWIPPlanning<---- What is this?  Is it datasource?
changeID.Text = Text(1),  <---- Where is this located?  Is it inside the gallery?
{
'Request Status': Dropdown1.Selected.Value,
Production_x0020_Week: Dropdown1_1.Selected.Result,
MenashaSite: Dropdown1_2.Selected.Value,
Cases_x0020_Short: TextInput2_1.Text,
Multiple_x0020_DU_x0020_Ind: Dropdown1_3.Selected.Value
}
)

 

 

@WarrenBelz feel free to jump in at any point.  I'm just collecting more data at this point but if you see the solution then go for it.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Highlighted
Kudo Collector
Kudo Collector

Re: Update All Records in Collection

@mdevaney  -

 

Screenshot enclosed! In my code I do not reference my gallery, but I did try gallery2.allitems (at some point in my trials). And also I do not have a column in my gallery for the change ID but I was thinking about having one added in when the data is pulled from SQL to create the collection.

 

SPDWIPPlanning,  <---- What is this?  Is it datasource? - Collection
changeID.Text = Text(1),  <---- Where is this located?  Is it inside the gallery? - Inside the gallery

 

 

Highlighted
Super User III
Super User III

Re: Update All Records in Collection

Hi @tlevine ,

I am in a different time zone, so have just caught up with this.

@mdevaney (as usual) has done the detective work well. Taking the "helicopter' view of this, you have confirmed that the patch works with the all record update, so I think we are Back to the Future looking at what is wrong in the filter match.

As this is a collection, have you looked at the datatypes in View > Collections ?

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Find your favorite faces from the community presenting at the Power Platform Community Conference!

Watch Now

Experience what’s next for Power Apps

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

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (5,390)