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 / Populate a dropdowns v...
Power Apps
Answered

Populate a dropdowns value based on field value

(0) ShareShare
ReportReport
Posted on by 59

Customised SharePoint list, this should be a really simple one, but it alludes me.  I want to set a dropdown value based on an expression in the number field 

 

I have  a number field    datacardvalue15   and a dropdown field of yes or no,  When the number field is >= 5 set the dropdown to yes otherwise no

 

Had this onchange of the number field

If(Value(DataCardValue15.Text)> =5 ,Set(var,"Yes"))

 

and on the default of the dropdown datacard  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Value:var} instead of its default value of thisitem.dropname

 

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    are you using a table or Excel?

  • sboneratm Profile Picture
    59 on at

    its a SharePoint dropdown and the datasource is a SharePoint list 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Do you have something like this

    example_13.PNG

    OneDrive > "Your SharePoint library" > Go to site > "Your List" > Settings Icon (Top right) > List settings > Edit or Create columns.

  • Rahber Profile Picture
    1,935 on at

    You have the correct syntax. I am not sure where is the problem?

     

    This is my code

     

    onChange code for the text field: If(Value(DataCardValue9.Text) >=5 ,Set(var,"Yes"),Set(var,"No")); 

     

    The default of the drop down should is var

     

    chrome-capture.gif

     

    Please click Accept as Solution if it resolved your problem or give it a Thumbs Up if it helped you in anyway this will allow other people to search correct solutions effectively.

    Thanks,

    Rahber

  • sboneratm Profile Picture
    59 on at

    the onchange gets accepted , however when  i put var as the default for the dropdown it expects a record , the dropdown is a standard sharepoint choices column

  • sboneratm Profile Picture
    59 on at

    As it was a sp dropdown I needed

    {'@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",

    Value:var}  on the whole datacard default value 

     

     

  • Rahber Profile Picture
    1,935 on at
    Can you please show us an image of your power app form screen and the tree view of that specific control.

    Is it a dropdown or combo box?
  • Verified answer
    v-yutliu-msft Profile Picture
    Microsoft Employee on at

    Hi @sbonera ,

    Could you tell me

    1)whether this choice column allows multiple choice?

    2)whether you use drop down or combo box?

     

    Please set like this:

    The textinput's OnChange:

    If(Value(DataCardValue15.Text)> =5 ,Set(var,"Yes"),Set(var,"No"))

    1)If the choice column not allow multiple choice and you use drop down:

    set the datacard's Default:

    var

    set the daracard's Update:

    dropdownname.Selected
    //please replace with this drop down's name

    set the drop down's Items:

    Choices(listname.fieldname)

     set the drop down's Default:

    Parent.Default

    The textinput's OnChange:

     

    If(Value(DataCardValue15.Text)> =5 ,Set(var,"Yes"),Set(var,"No"))

     

    2)If the choice column not allow multiple choice and you use combo box:

    set the datacard's Default:

     

    {Value:var}

     

    set the daracard's Update:

     

    comboboxname.Selected
    //please replace with this combo box's name

     

    set the combo box's Items:

     

    Choices(listname.fieldname)

     

     set the combo box's DefaultSelectedItems:

     

    Parent.Default

     

    3)If the choice column allow multiple choice and you use combo box:

    set the datacard's Default:

     

    Table({Value:var})

     

    set the daracard's Update:

     

    comboboxname.SelectedItems
    //please replace with this combo box's name

     

    set the combo box's Items:

     

    Choices(listname.fieldname)

     

     set the combo box's DefaultSelectedItems:

     

    Parent.Default

     

     

     

    Best regards,

     

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!

Leaderboard > Power Apps

#1
Haque Profile Picture

Haque 85

#2
WarrenBelz Profile Picture

WarrenBelz 76 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 38 Super User 2026 Season 1

Last 30 days Overall leaderboard