cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kORINNERB
Helper II
Helper II

Combo box will not patch to sharepoint list

hi i am trying to patch the information from combox 1 into a sharepint list using the formula below, red is the combox 1 part of the formula, the other items seem to patch ine but when i add combo box 1 it doesnt like it. 

 

The information in combobox 1 is from a different sharepoint list, however the information in field i am patching to in the other sharepoint list that the new records go to is a look up field too 

 

Can you advise?

 

ForAll(RenameColumns(Filter(Chosencollection,isticked),"ID","TEST"),Patch('QHSE Audit App',Defaults('QHSE Audit App'),{'Cert No/Comments: ':TextInput3.Text},{'Audit ID':Label8.Text},{'Most Recent Date ':DatePicker2.SelectedDate},{Available:Dropdown3.Selected},{'Audit Status':Label9.Text},{'Location Name':ComboBox1.SelectedItems.Result}));ClearCollect(Chosencollection,AddColumns('QHSE Audit Information - NEW',"isticked",false))

2 ACCEPTED SOLUTIONS

Accepted Solutions

Hi @kORINNERB ,

Firstly a suggestion - ask yourself why you are using a lookup column when you can do the same thing in Power Apps without all the complication and difficulties (and this is one of many) these bring for you - I have not used them for a long time and have a blog that may assist you.

Now to your issue - you do not need to rename ID as you are not using it in the Patch. The Lookup Patch is a little complex, but you need to understand it.

ForAll(
   Filter(
      Chosencollection,
      isticked
   ),
   Patch(
      'QHSE Audit App',
      Defaults('QHSE Audit App'),
      {
         'Cert No/Comments: ':TextInput3.Text,
         'Audit ID':Label8.Text,
         'Most Recent Date ':DatePicker2.SelectedDate,
         Available:aPatch.Dropdown3.Selected,
         'Audit Status':aPatch.Label9.Text,
         'Location Name':
         {
            Value:ComboBox1.Selected.Result,
            Id:
            LookUp(
               Locations,
               Description = ComboBox1.Selected.Result
            ).ID
         }
      }
   )
);
ClearCollect(
   Chosencollection,
   AddColumns(
      'QHSE Audit Information - NEW',
      "isticked",
      false
   )
)

Bear in mind also I have assumed the rest of your references are valid and have only addressed Location.

 

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

Hi Warren

 

Thank you somuch, had to make a tweak below to the formula but this has worked for me

 

ForAll(
Filter(
Chosencollection,
isticked
),
Patch(
'QHSE Audit App',
Defaults('QHSE Audit App'),
{
'Cert No/Comments: ':TextInput3.Text},
{'Audit ID':Label8.Text},
{'Most Recent Date ':DatePicker2.SelectedDate},
{Available:Dropdown3.Selected},
{'Audit Status':Label9.Text},
{'Location Name':
{
Value:ComboBox1.Selected.Result,
Id:
LookUp(
Locations,
Description = ComboBox1.Selected.Result
).ID
}
}
)
);
ClearCollect(
Chosencollection,
AddColumns(
'QHSE Audit Information - NEW',
"isticked",
false
)
)

 

Thank you 

 

Korinne

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @kORINNERB ,

What type of field is 'Location Name' and what are the Items of ComboBox1?

Hi Warren,

 

The location name is a look up field in Sharepoint and the items in combo box 1 is a different Sharepoint list called locations, see items for combo box 1 below;

 

Distinct(Filter(Locations,Dept = Dropdown6.Selected.Result),Description)

 

Thank you for your help 

 

Korinne

 

 

Hi @kORINNERB ,

Firstly a suggestion - ask yourself why you are using a lookup column when you can do the same thing in Power Apps without all the complication and difficulties (and this is one of many) these bring for you - I have not used them for a long time and have a blog that may assist you.

Now to your issue - you do not need to rename ID as you are not using it in the Patch. The Lookup Patch is a little complex, but you need to understand it.

ForAll(
   Filter(
      Chosencollection,
      isticked
   ),
   Patch(
      'QHSE Audit App',
      Defaults('QHSE Audit App'),
      {
         'Cert No/Comments: ':TextInput3.Text,
         'Audit ID':Label8.Text,
         'Most Recent Date ':DatePicker2.SelectedDate,
         Available:aPatch.Dropdown3.Selected,
         'Audit Status':aPatch.Label9.Text,
         'Location Name':
         {
            Value:ComboBox1.Selected.Result,
            Id:
            LookUp(
               Locations,
               Description = ComboBox1.Selected.Result
            ).ID
         }
      }
   )
);
ClearCollect(
   Chosencollection,
   AddColumns(
      'QHSE Audit Information - NEW',
      "isticked",
      false
   )
)

Bear in mind also I have assumed the rest of your references are valid and have only addressed Location.

 

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 Warren

 

Thank you somuch, had to make a tweak below to the formula but this has worked for me

 

ForAll(
Filter(
Chosencollection,
isticked
),
Patch(
'QHSE Audit App',
Defaults('QHSE Audit App'),
{
'Cert No/Comments: ':TextInput3.Text},
{'Audit ID':Label8.Text},
{'Most Recent Date ':DatePicker2.SelectedDate},
{Available:Dropdown3.Selected},
{'Audit Status':Label9.Text},
{'Location Name':
{
Value:ComboBox1.Selected.Result,
Id:
LookUp(
Locations,
Description = ComboBox1.Selected.Result
).ID
}
}
)
);
ClearCollect(
Chosencollection,
AddColumns(
'QHSE Audit Information - NEW',
"isticked",
false
)
)

 

Thank you 

 

Korinne

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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