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 defaultselec...
Power Apps
Unanswered

combo box defaultselecteditems value

(0) ShareShare
ReportReport
Posted on by 321

I have combo box control on the form.
This combo box should load the ticked data here and put this value in sharepoint.

Currently, if I submit the data by putting the checked data in the checkbox, the data will not go in. So I want to change the code in the DefaultSelectedItems attribute of this combo box. However, there is an error and I can't solve it, so please help me,,

Bingqiling_1-1703050271160.pngBingqiling_2-1703050291553.png

Code to change:

 

If(
 Form1_11.Mode = FormMode.New,
 LookUp(
 Choices([@ITAM_application].reAsset),
 Value = checkvalue.product_name 
//Filter(myListGallery_4.AllItems, Checkbox1.Value) //checkvalue.product_name // Value 
 ), Parent.Default
)

 

error messege:

Uncomparable type.
Text or Table types are not comparable.

Bingqiling_0-1703049960812.png

 

Categories:
I have the same question (0)
  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @Bingqiling 

    Here’s a modified version of your formula, assuming both Value and checkvalue.product_name are text:

    If(
    Form1_11.Mode = FormMode.New,
    LookUp(
    Choices([@ITAM_application].reAsset),
    Value = Text(checkvalue.product_name)
    ),
    Parent.Default
    )

    In this modified formula, I’ve used the Text function to ensure that checkvalue.product_name is treated as text, which should match the data type of Value in your Choices function. If checkvalue.product_name is already a text, then Text function is not necessary.

    If the types are different (e.g., one is a record and the other is text), you’ll need to adjust the formula to ensure you’re comparing like types.

    It’s also important to understand the structure of your data and how the Choices function works with your data source. Sometimes, understanding the underlying data types and structures can help in formulating the correct formula.

     

  • Bingqiling Profile Picture
    321 on at

    @Jcook hi Thank you for your advice

    Bingqiling_0-1703052109192.pngBingqiling_1-1703052145393.png

    An error has occurred again. error messege is~

    Text or number is required.

    Text or number is required at this point in the expression.

    Function "Text" has some invalid arguments.

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @Bingqiling 

     

    If you can provide more details about the checkvalue (such as where and how it’s set), the data source structure, and the specific requirements of your SharePoint list, I can assist more effectively in troubleshooting the issue.

    In the meantime, you might try a simpler version of the expression to see if it works, and then build complexity from there:

     

    If(
    Form1_11.Mode = FormMode.New,
    { Value: checkvalue.product_name },
    Parent.Default
    )

     

  • Bingqiling Profile Picture
    321 on at

    hi @Jcook 

    Bingqiling_0-1703053760918.pngBingqiling_1-1703053786508.png

    That's what happened.

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @Bingqiling 

     

    Here’s another attempt at modifying your formula, assuming checkvalue.product_name is a text and you need to match it with a text field in your Choices:

     

    If(
    Form1_11.Mode = FormMode.New,
    LookUp(
    Choices([@ITAM_application].reAsset),
    YourTextFieldName = checkvalue.product_name
    ),
    Parent.Default
    )

     

    In this formula, replace YourTextFieldName with the actual field name in [@ITAM_application].reAsset that you want to match against checkvalue.product_name.

     

    If checkvalue.product_name is part of a more complex object, you might need to further drill down to extract the specific text value. Understanding the exact structure of checkvalue and how it’s being set in your app is crucial for a precise solution. If you can provide more details about the structure of checkvalue and your data source, it would be helpful in troubleshooting the issue.

     

  • Bingqiling Profile Picture
    321 on at

    @Jcook 

    table nameITAM_appliITAM_asset
    column namereAssetproduct_name
    data typeSearch(ITAM_asset-product_name)Text

    Bingqiling_2-1703055601598.png

     

    Bingqiling_1-1703055366692.png

    Bingqiling_3-1703055654501.png

    "checkvalue" is a variable, so it's a text type, right?

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    @Bingqiling 

     

    Looks like the variable

    is referencing a table.

     

    can you try this:

    If(
    Form1_11.Mode = FormMode.New,
    checkvalue,
    Parent.Default
    )

    if you get an error. Let me

    know what the error is. Also can you tell me

    what the Items property is for your Combobox

     

  • Bingqiling Profile Picture
    321 on at

    hi @Jcook 

    Bingqiling_0-1703123062237.png

    Bingqiling_1-1703123090017.png

    The error disappeared from the app.
    However, it was not stored in sharepoint.

    what the Items property is for your Combobox: Bingqiling_2-1703123125984.png

     

  • Jcook Profile Picture
    7,781 Most Valuable Professional on at

    Hi @Bingqiling 

     

    So the error is gone?

    what’s the error now, what do you mean now stored in SharePoint?

     

  • Bingqiling Profile Picture
    321 on at

    hi @Jcook 

    Thank you for your hard work.

    There is no error on the screen.
    However, if i submit this form, it will not be saved to sharepoint.
    It just shows it on the screen and the actual data is not delivered to the DB.

    I need to store this data in sharepoint.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 514

#2
WarrenBelz Profile Picture

WarrenBelz 419 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 295

Last 30 days Overall leaderboard