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 / Setting value of Dropd...
Power Apps
Answered

Setting value of Dropdown with "Table" datasource

(1) ShareShare
ReportReport
Posted on by 130

Hi all,

 

I have a Dropdown on my form with the following properties.

 

ItemsTable({Text: "Examination", Val: "X"}, {Text: "Expiry", Val: "E"}, {Text:"Observation", Val: "O"})
ValueText
DefaulteditRecord.EventType
ResetresetForm

 

I have a gallery of items which the user can select which should then show the appropriate value of the drop down, but it is not. The code for the OnSelect() of the gallery is

 

Set(editRecord,{ID: ThisItem.Id, EventType: ThisItem.EventType);

// Force update of form controls

Set(resetForm, true);

Set(resetForm, false);

 

The EventType property is E, X or O, as per the table of items but the Dropdown does not change from the first value in its Items list, irrespective of he value of the EventType field. I can see that the field is changing as per selecting each item as I have a (temporary) label showing the value.

 

I surley think it's me doing something stupid ... I just cannot see what.

Categories:
  • Verified answer
    mdevaney Profile Picture
    29,993 Moderator on at

    @BO55VXR 

    First things first, you must be using a ComboBox as opposed to a Dropdown here because your table has 2 columns: Text and Value.  There's a difference in how these controls work so the distinction is important.

     

    For ComboBoxes you need to define a record as the default.  I get the feeling that editRecord.EventType only supplies a text value.  This will not work.

     

    You'll need to put your table of options into a collection.  Do this in the OnVisible property of the screen.

     

    ClearCollect(colOptions, Table({Text: "Examination", Val: "X"}, {Text: "Expiry", Val: "E"}, {Text:"Observation", Val: "O"}))

     

    Then change the Items property of your ComboBox 

     

    colOptions

     

    Finally, use a LOOKUP function in the Default property of the ComboBox to retrieve a record value instead of a text value like you were doing previously.

     

    LookUp(colOptions, Val = editRecord.EventType)

     

    ---
    Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

     

     

     

  • Chris Hammond Profile Picture
    130 on at

    Smashing ... 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 411 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 338

#3
WarrenBelz Profile Picture

WarrenBelz 256 Most Valuable Professional

Last 30 days Overall leaderboard