Hi All!
I am trying to patch into just one item in a SharePoint list with over 600 items. Sometimes, the patch with come through. Sometimes it won't. I am not getting a delegation warning and I also placed the save/patch icon within the gallery itself. How can I make this consistently save/patch? The patch formula I am using is below.
Solved! Go to Solution.
Hi @Anonymous,
Indeed, all of the formula's you suggested were working. I now found what was wrong. It turns out all the fields/columns (Week1, Week3, Week3, Week4) needed to have an initial value. That was the pattern I noticed. So for the other items, they all had blanks for those fields while the others had zeros. So the quick fix was to put a zero at the fields and had it default to zero. My users edit it and enter a digit from 1-100 so it's all good. I just didn't know it had to have an initial value for the patch to work 🤦🏽♂️
Thank you so much for all your suggestions/replies @Anonymous , @RandyB , @classicman!
Try using this:
Patch(
mySharePointList,
ID = mySharePointListGallery.Selected.ID,
{
Week1: Value(tmWk1.Text),
Week2: Value(tmWk2.Text),
Week3: Value(tmWk3.Text),
Week4: Value(tmWk4.Text),
Notes: tmNotes.Text
}
)
Thank you @Anonymous for your reply but I get a "The function 'Patch' has some invalid arguments" when I tried it.
I believe what @Anonymous was going for was the UpdateIf function:
UpdateIf(
mySharePointList,
ID = mySharePointListGallery.Selected.ID,
{
Week1: Value(tmWk1.Text),
Week2: Value(tmWk2.Text),
Week3: Value(tmWk3.Text),
Week4: Value(tmWk4.Text),
Notes: tmNotes.Text
}
)
@RandyHayes That was going to be my next suggestion - shoulda gone there first lol
@Anonymous
Yep - as I read the post I was thinking to do an UpdateIf - then saw your replay and noticed the mistype.
@Bochie Give @Anonymous 's suggestion a try (with the change to UpdateIf) and see if that hits the nail on the head for you.
If not, the other things to consider are potential conversion issues with the Value functions. Is there a possibility that one of them is failing...which can cause the entire patch to fail.
Hi @RandyHayes and @Anonymous ,
I tried the UpdateIf function and it resulted to updating all the columns/fields being updated even if I ONLY updated a single column (for example only tmWk1 field was updated). I still can't figure out though why Patch wouldn't work for some? Could it be a delegation issue? It doesn't give me a squiggly line so I didn't consider that before. Thanks much for your responses!
Where is your patch being stored? Not sure what your design for this looks like, but I typically gravitate to using ThisItem. Might be more effective to assign the Patch function to the field you're updating so that you're only updating what you intend to.
Patch(
mySharePointList,
ThisItem,
{
Week1: Value(tmWk1.Text),
Week2: Value(tmWk2.Text),
Week3: Value(tmWk3.Text),
Week4: Value(tmWk4.Text),
Notes: tmNotes.Text
}
)
Hi @classicman , if your question was which control triggers the Onselect event, it's an icon inside the gallery itself. I was using mySharePointListGallery.Selected and changed that to your suggestion with "ThisItem" for the patch. It's still behaving the same: it would work in some of the records, but won't work on the others. That really is what I cannot figure out. When I use the UpdateIf function, all the fields are set to "0" zero after the update, nothing from the Text Input control is passed. Thanks for your response!
Hmm...How about this:
Patch(
mySharePointList,
First(Filter(mySharePointList, ID = mySharePointList.Selected.ID)),
{
Week1: Value(tmWk1.Text),
Week2: Value(tmWk2.Text),
Week3: Value(tmWk3.Text),
Week4: Value(tmWk4.Text),
Notes: tmNotes.Text
}
)
User | Count |
---|---|
261 | |
110 | |
90 | |
54 | |
44 |