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 / How to set the default...
Power Apps
Answered

How to set the default value of combox box

(0) ShareShare
ReportReport
Posted on by 2

I am using Teams Power app

 

I have a text box, whose value property is as below, this is working fine, 

MIA27_2-1712166196704.png

 

But when I apply the same on default of combo box its giving me error

MIA27_3-1712166243701.png

Items is based on collection, which is working, Default selected item I put 

["INITIAL"]
This is working fine.
 
only default property it is not accepting. I am writing the same as of text, as due to that code, I can see the old records based on the selection of gallery.
 
Please guide, how to be written 
 
 

 

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @MIA27,

     

    Would it be possible to try the following code in the DefaultSelectedItems property:

    If(
     //I expect the var to be of type boolean (true/false)
     !gblReturnNewRecord,
     SearchResultGallery_3.Selected.'Status (cr333_status)'
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • MIA27 Profile Picture
    2 on at

    Dear Lauren,

    Applied the code you advise, getting the below error:

     

    MIA27_0-1712204642283.png

     
    If(
        //I expect the var to be of type boolean (true/false)
        !gblReturnNewRecord,
        SearchResultGallery_3.Selected.'Status (cr333_status)'
    )
     
    The !gblReturnNewRecord, is boolean (true/false)
    Cannot understand, its working on Text then why not working on Combo
     
    Please guide
  • MIA27 Profile Picture
    2 on at

    Even I tried Below, so that default selection will be there and if it is on the old record then just refer to the gallery selected as shown below - BUT this also does not work.

     

    If(gblReturnNewRecord,LookUp(PartsReturnStatus, ReturnStatus = "INITIAL"),Value(SearchResultGallery_3.Selected.'Status (cr333_status)'))
     
    error message of expected a table value :
    MIA27_0-1712207637735.png

     

    Please guide

     
     
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    Hi @MIA27,

     

    My apologies for the delay. Enclosing the value between brackets (creating an array / table), should do the trick:

    If(
     //I expect the var to be of type boolean (true/false)
     !gblReturnNewRecord,
     [SearchResultGallery_3.Selected.'Status (cr333_status)']
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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 541

#2
WarrenBelz Profile Picture

WarrenBelz 434 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 289

Last 30 days Overall leaderboard