web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patching combobox serc...
Power Apps
Answered

Patching combobox serchtext

(1) ShareShare
ReportReport
Posted on by 27

Hello community,

 

i need some asistance on how to achieve the below:

What i have:

  • a Form(new) that updates an SP list called "Main List"
  • a Combobox in this form that shows items from another  Sharepoint "Model" list.

What i try to achieve is that IF the model entered in the combobox's  search-text is not included or being displayed as option, then this model should be patched to the SP "Model" List AND of course saved in the list item being created on the "Main List".

 

Thanks everybody and take care.

 

Categories:
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    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:

    1. what the column type that you fill the Combo Box, a Choice from "Model" list or a Lookup in the "Main List"?
    2. 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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 393 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 278 Most Valuable Professional

Last 30 days Overall leaderboard