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 / Combo Box output Searc...
Power Apps
Unanswered

Combo Box output SearchText to create new dropdown item - Error with If function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello!

 

I'm trying to create a combobox to which users can add items on the fly. Since PowerApps combo boxes don't have that ability by default, my workaround is using the following formula in the 'Update' property in order to get the combobox to return the search text value if there is no match in the dropdown items:

 

If(IsBlank(DataCardValue10.Selected),DataCardValue10.SearchText,DataCardValue10.Selected) 

Where 'DataCardValue10' is the name of the combo box.

 

However, I'm getting the error "The function "If" has some invalid arguments". 

 

Does anyone know what may be going on? I've been messing around with it and when I use the following piece of code it seems to get rid of the error, so I'm guessing DataCardValu10.SearchText is the wrong datatype, but I'm not sure how to fix it.

 

If(IsBlank(DataCardValue10.Selected),DataCardValue10.Selected,DataCardValue10.Selected) 

PowerApps Error.png
Categories:
I have the same question (0)
  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Hi @Anonymous,

    I love your idea of a combobox that adds items on the fly. I did an experiment using a data source of Doctors, and I wanted to see if I could add a name and city to an existing list using your idea.    I added a combobox to an existing card of City.  The Items property of the combobox was Distinct(Doctors,City).  The Update property of the card was 

    If(
        IsBlank(ComboBox6.Selected.Result),
        DataCardValue157.Text,
        ComboBox6.Selected.Result
    )

     

    It worked perfectly. After submitting the form, the ComboBox now contained the new city.  Kudos to you for your idea of dynamically adding an item to a combobox.  It should also work with Dropdown controls as well. 

    AddNewItemCombobox.PNG

     

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Good to see that it can work! I wish I could figure out why mine is acting up. 

     

    The items property of my combo box is Choices('Name of SharePoint List'.Column_x0020_within_x0020_list)

     

    Could that be a source of error?

  • Drrickryp Profile Picture
    Super User 2024 Season 1 on at

    Definitely. I don't like to use lookups and choices in Sharepoint because they are difficult to update from Powerapps.  I change them to single line of text and number types and I find it easier to work with them. I come from a background in MS Access originally and was taught to use Foreign keys in related tables rather than use lookups in the original table to reference another table.  I am sure one of the other MS employees can give you a better way to deal with those types of Sharepoint columns.

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
WarrenBelz Profile Picture

WarrenBelz 392 Most Valuable Professional

#2
11manish Profile Picture

11manish 181 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 112 Super User 2026 Season 2

Last 30 days Overall leaderboard