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))
Solved! Go to Solution.
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
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