cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tlevine
Kudo Commander
Kudo Commander

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

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

 

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

I see nothing wrong with the syntax.

Have you tried a ForAll with a Patch?

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!

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

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!

 

 

mdevaney
Super User
Super User

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

@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

 

 

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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,751)