cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Francis99
Frequent Visitor

Patching Combobox Items- SP List

Hi, I am a relatively new PowerApp user and am creating a form to document field upgrades. I have a SP list (called Fake_Testing List) of 12,000+ rows serving as my database where units have a location, configuration details and unique SN. 

SP List.PNG

I want to be able to have the user fill out the form and then select multiple SN's to a combobox (cboxDataSN) and upon submission, patch each record that was included in the DataSN combobox. Every SN in the SP List is unique. Ideally, if a part SN was not found in the SP List, then a new record would be made instead. 

 
 

I got the patch to work for a single SN but I cannot patch all the items selected in the combobox. Any help to get all selected items patched is appreciated! Here is the code for that patch:

 

 

 

 

ForAll(
  cboxDataSN.SelectedItems,
  Patch('Fake_Testing List',LookUp('Fake_Testing List','Databox SN' = cboxDataSN.Selected.Result,
  {'Item No' : ddItemNo.Selected.Value, 
  'EV Configuration': ddEVConfig.Selected.Value, 
  'Upgrade Reality': ddUpgradeReality.Selected.Value, 
  'Addendum Given': ddAddendum.Selected.Value})))

 

 

 

 

My powerApp fields are ddItemNo, ddEVConfig, cboxDataSN, cboxPumpSN, ddUpgradeReality, and ddAddendum. Thank you in advance!

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User
Super User

@Francis99 
I think the problem is with your lookup statement.  Without using a collection there is no way to properly iterate over all of the Databox SN values.  Your lookup statement was not targeting any records.

 

ClearCollect(colDataSN, cboxDataSN.SelectedItems.'Databox SN');
ForAll(
  colDataSN,
  Patch('Fake_Testing List',LookUp('Fake_Testing List','Databox SN' = colDataSN[@Databox SN]),
  {'Item No' : ddItemNo.Selected.Value, 
  'EV Configuration': ddEVConfig.Selected.Value, 
  'Upgrade Reality': ddUpgradeReality.Selected.Value, 
  'Addendum Given': ddAddendum.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."

View solution in original post

4 REPLIES 4
mdevaney
Super User
Super User

@Francis99 
I think the problem is with your lookup statement.  Without using a collection there is no way to properly iterate over all of the Databox SN values.  Your lookup statement was not targeting any records.

 

ClearCollect(colDataSN, cboxDataSN.SelectedItems.'Databox SN');
ForAll(
  colDataSN,
  Patch('Fake_Testing List',LookUp('Fake_Testing List','Databox SN' = colDataSN[@Databox SN]),
  {'Item No' : ddItemNo.Selected.Value, 
  'EV Configuration': ddEVConfig.Selected.Value, 
  'Upgrade Reality': ddUpgradeReality.Selected.Value, 
  'Addendum Given': ddAddendum.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."

View solution in original post

Hi Mdevaney,

 

That makes sense for the collection, thank you. Tried the code you provided and unfortunately it is providing a delegation error involving the LookUp formula and in specific the colDataSN[@'Databox SN'] (underlined in blue).Delegation Issue.PNG

 

After submitting/patching the form, the SP List is updated with a new record (missing the SN) instead of updating the record with the SN (EV061170) that was placed in the cboxDataSN as shown below:

 

SharePoint Patch Issue.PNG

@Francis99 
The LOOKUP formula is simply missing its closing bracket.  That's all!

 

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

Thank you @mdevaney , appreciate your help and timely responses! 😎

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (1,043)