Hi@LTEVA,
Based on the issue that you mentioned, do you want to patch the search text to "Model" list and update it to "Main List"?
Could you please tell me that:
- what the column type that you fill the Combo Box, a Choice from "Model" list or a Lookup in the "Main List"?
- is this a custom form that you created using controls one by one?
If the column you fill the Combo Box is a Lookup column type, I think there is no way to patch the SearchText to neither the "Model" list nor "Main List". The reason is that the Lookup column needs a record rather than a value when patching and the Id defines that the item you want to patch surely exists in the list where you created a Lookup column.
In a word, you could not patch the SearchText in a Combo Box that filled with a Lookup column.
As an alternative solution, I think you could try a collection which costs some time but it could solve your problem at some degree.
Create a new SP list and create columns as they are in the Main list, make sure that change the column that you fill the Combo Box into a Text type rather than a Lookup.
In my scenario, I have a SP list named 'tSheet2', a Text column named Teammate and a Lookup column named 'shared status'.
Collect your Main list as below:
Collect(Test,tSheets2)
Format the collection to get access to the value of the Lookup column and keep the value only as below:
Collect(Test1,ShowColumns(AddColumns(Test,"Shared",'shared status'.Value),"Teammate","Shared"))
Save the collection to the new SP list as below:
Collect(Test1,ShowColumns(AddColumns(Test,"Shared",'shared status'.Value),"Teammate","Shared"));ForAll(Test1,Patch('NewMainList',Defaults('NewMainList'),{NewColumn1:Teammate,NewColumn2:Shared}))
Add a Gallery5 to display all the records and set the OnSelect of the ">" as below:
Select(Parent);Navigate(Form1)
Add a Form1 to update the 'NewMainList' and a Combo Box outside it.
Set Item of the Form1 as below:
Gallery5.Selected
Set the Items property of the Combo Box as below:
Distinct('ModeList',Model)
Add a submit button to update the 'NewMainList':
Patch(NewMainList,Gallery5.Selected,{NewColumn2:If(ComboBox7.SearchText in Distinct('ModeList',Model).Result,ComboBox7.Selected.Result,ComboBox7.SearchText)})
Add a button to patch the new item to the ModeList.
Make it in edit mode only when the model entered in the combobox's search-text is not included
If(ComboBox7.SearchText in Distinct(ModeList,Model).Result,Disabled,DisplayMode.Edit)
It patches a new item to the ModeList when the model entered in the combobox's search-text is not included
Patch(ModeList,Defaults(ModeList),{Model:ComboBox7.SearchText})
Regards,
Qi