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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combobox going blank w...
Power Apps
Unanswered

Combobox going blank when updating the SearchText (what was written)

(0) ShareShare
ReportReport
Posted on by 818

For my Sharepoint list form I have a Text column that Updates from a Combobox that its option come from an Excel table.  As of now, the DefaultSelectedItems property looks like this:

 

If(
 !IsBlank(Parent.Default);
 LookUp(CustomerExcelTable; ExcelColumn = Parent.Default);
 Blank()
)

 

So this makes it so that it saves whatever was selected when you go to edit. The Update property of this datacard, looks like this:

 

If(
 !IsBlank(ComboBox1.Selected.ExcelColumn);
 ComboBox1.Selected.ExcelColumn;
 !IsBlank(ComboBox1.SearchText);
 ComboBox1.SearchText
)

 

This code is for using what was written in the combobox should one of the Excel options not be included in what the user wants to input. On another Combobox this Update code Worked no trouble, altough that was a much easier choice column, and in DefaultSelectedItems I put "Parent.Default" (already tried swapping the Blank() with the Parent.Default, and gives an error that a Table value was expected).

The code for that choice column Update combobox looks like this, very similar to last one:

If(
 !IsBlank(DataCardValue26.Selected);
 DataCardValue26.Selected;
 !IsBlank(DataCardValue26.SearchText);
 {
 Value: DataCardValue26.SearchText
 }
)

So mmm Is this fixable? Appreciate your input in advance!

Categories:
I have the same question (0)
  • WarrenBelz Profile Picture
    153,136 Most Valuable Professional on at

    Hi @WorkingRicardo ,

    Try this

    {
     Value:
     Coalesce(
     DataCardValue26.Selected.Value,
     DataCardValue26.SearchText
     )
    }

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • WorkingRicardo Profile Picture
    818 on at

    Hey @WarrenBelz ty for your reply:

    That goes in the update property? The one I need fixing is the one with Combobox on the code, not DataCardValue26. I changed it to match my setting:

     

    {
     Value:
     Coalesce(
     ComboBox1.Selected.No_;
     ComboBox1.SearchText
     )
    }

     

    (No_ is the Excel column). And this gives an error that a Text value was expected.

     

    The only way I could get it with no error was 

     

     Coalesce(
     ComboBox1.Selected.No_;
     ComboBox1.SearchText)

     

    But this only save whatever was selected from Excel, not what was written in Combobox1

    Either way, the problem is not in the Update part, as all codes have saved to Sharepoint. The problem is that the item goes blank when u got to edit it. I'm assuming something must be done in the DefaultSelectedItems part

  • WarrenBelz Profile Picture
    153,136 Most Valuable Professional on at

    @WorkingRicardo ,

    What type of field in SharePoint are you writing back to here ? I assumed it was a Choice column as you used {Value: . . } . Also that is the Items of ComboBox1 ?

  • WorkingRicardo Profile Picture
    818 on at

    @WarrenBelz 

    The code I'm having trouble with (Combobox one) is writting a Text field Sharepoint column.

    The value one which I only put as an example on another setting the code was working is a choice column.

    This shouldn't be trouble as for many other Text columns I have been populating it this way. 

  • WarrenBelz Profile Picture
    153,136 Most Valuable Professional on at

    @WorkingRicardo ,

    This is where the confusion lies - if you are writing back to a Text field, then this should be correct

    Coalesce(
     ComboBox1.Selected.No_;
     ComboBox1.SearchText
    )

    If nothing is selected, it should write the SearchText. Is this a Classic or Modern Combo Box ? If Modern, I suggest you switch to Classic if it is not working for you.

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • WorkingRicardo Profile Picture
    818 on at

    Hey again @WarrenBelz !
    Oh 😞 This code is only saving to sharepoint list (both for Excel option selected and written text. If you saved a written text and not a selected option, when you open the item, it goes blank. Again, the problem must lie on DefaultSelectedItems. I change the code around a bit but still goes blank: 

    If(
     !IsBlank(Parent.Default);
     LookUp(Wilo_Iberica_S_A__Customer; No_ = Parent.Default);
     {Value: Parent.Default}
    )
    
    (before instead of {Value: Parent.Default}, I had "Blank()"

    The problem is not in saving the data to sharepoint, is retaining the data into the combobox once you open again

  • WarrenBelz Profile Picture
    153,136 Most Valuable Professional on at

    @WorkingRicardo ,

    You have not included the Text field name that you are writing to in SharePoint. The DefaultSelectedItems should be

    {_No: ThisItem.SPFieldName}

     

    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.

    MVP (Business Applications)   Visit my blog Practical Power Apps

  • WorkingRicardo Profile Picture
    818 on at

    Hey again! @WarrenBelz  i tried that code but now it goes blank in every ocassion (written text + selected from combobox). Tried this below code that checks to see if something was selected from the table (this retain the selected excel value) but then if you write something... Nope

     

    If(
     !IsBlank(Parent.Default);
     LookUp(Customer; No_ = Parent.Default);
     {_No: ThisItem.'Número cliente'}
    )

     

     

  • WarrenBelz Profile Picture
    153,136 Most Valuable Professional on at

    @WorkingRicardo ,

    This is getting a bit confusing with your logic as you are saying if Parent.Default is not blank, use something else, otherwise use Parent.Default (which would then be blank, so why use it).

    So firstly can you please tell me what is the Default of the Data Card this Combo Box is in ? Also please confirm the Items of the Combo Box (in Text please - you did not fully answer that before)

  • WorkingRicardo Profile Picture
    818 on at

    @WarrenBelz 

    Default of Datacard with the combobox:

    ThisItem.'SharepointColumnName'

    Items of the combobox

    ExcelColumn

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 740 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 342 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard