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 get the selecte...
Power Apps
Unanswered

How to get the selected value of a combo box that can have 2 types of items

(0) ShareShare
ReportReport
Posted on by 2,074 Season of Giving Solutions 2025

I have a combobox representing Locations with this formula for the Items:-

 

If(
 IsBlank(DashBoardStreetComboBox_1.Selected),
 Sort(
 Distinct(
 colOptionsForChoices,
 'Location Name'
 ),
 ThisRecord.Value,
 SortOrder.Ascending
 ),

 Filter(
 Locations,
 StreetTitle = DashBoardStreetComboBox_1.Selected.Value
 ).Title
 )

in other word if the user does not select any street, to show all the Locations from the colOptionsForChoices collection, if the user select a street to only show the location related to the street.. the above formula is not raising any error. but when i tried to select the selected value for the Location combobox, i got this error:-

 

johnjohnPter_0-1718030839111.png

 

any advice

Categories:
  • MTNK Profile Picture
    819 Moderator on at

    @johnjohnPter 

    As I understand, you would like to auto populate one item for a Combo box(with 2 items as drop down selection) based on other column selection.

  • johnjohnPter Profile Picture
    2,074 Season of Giving Solutions 2025 on at

    @mtsts I want to select the selected Location item from the LocationCombobbox, this item can be from :-

     

    1) colOptionsForChoices collection

    2) OR from the Filter(Locations..)

     

    so the value can be the Title of the sharepoint list item or the Value of the collection item... did u get my point?

    Thanks

  • MTNK Profile Picture
    819 Moderator on at

    @johnjohnPter I did not get it. Please do share the images for the columns with dropdown options. It would be easy for me to understand your question and help you.

  • johnjohnPter Profile Picture
    2,074 Season of Giving Solutions 2025 on at

    @mtsts here are the Streets & Locations comboboxes, as follow:-

     

    johnjohnPter_0-1718034618228.png

     

     

    and here is how i am building the collection on the screen onvisible property,:-

     

    //store the options to popualte the dropdowns based on the available data onky
    ClearCollect(colOptionsForChoices,Filter('Work Orders',
    ('Work Order Status'.Value = "Assigned" Or 'Work Order Status'.Value="New") And
    (Street = colSelectedStreetName Or IsBlank(colSelectedStreetName)) And
    (Direction = colSelectedDirectionName Or IsBlank(colSelectedDirectionName)) And
    ('Location Name' = colSelectedLocationName Or IsBlank(colSelectedLocationName)) And
    ('Work Order Type'.Value = colSelectedTypeName Or IsBlank(colSelectedTypeName)) And
    ('Technician Name'.Email = colSelectedTechnicianName Or IsBlank(colSelectedTechnicianName) Or 'Work Order Type'.Value ="Posting"
    Or 'Work Order Type'.Value ="UnPosting" Or 'Work Order Type'.Value ="Campaigns Photos" ) And
    (Brand = colSelectedBrandName Or IsBlank(colSelectedBrandName)) And
    ('Work Order Status'.Value = colSelectedTStatusName Or IsBlank(colSelectedTStatusName))
    ));

     

    is the case clear for you now?

    thanks

  • MTNK Profile Picture
    819 Moderator on at

    @johnjohnPter 

     

    Here is the another solution - 

     

     You can try this way to check - 

     

     It sounds like you want to select an item from a LocationCombobbox based on either the Title of a SharePoint list item or the Value of an item in the colOptionsForChoices collection.

     

    Let’s break it down:

     

    1.

    Selecting from colOptionsForChoices Collection:
    If you want to select an item from the colOptionsForChoices collection, you can directly use the Value property of the collection item. For example:


    UpdateContext({ SelectedLocation: colOptionsForChoices.Selected.Value });

     

     

    2. Selecting from Filtered Locations:
    If you want to select an item from a filtered set of locations (e.g., using Filter(Locations, ...)), you’ll need to specify the condition for filtering. Assuming you have a filter condition (let’s call it LocationFilter), you can do something like this:
    UpdateContext({ SelectedLocation: First(Filter(Locations, LocationFilter)).Title });

     

    Remember to adjust the variable names (SelectedLocation, colOptionsForChoices, Locations, etc.) according to your app’s context.

     

    Let me know if you need further assistance!

  • MTNK Profile Picture
    819 Moderator on at

    @johnjohnPter 

     

    Here is the another solution - 

     

     You can try this way to check - 

     

     It sounds like you want to select an item from a LocationCombobbox based on either the Title of a SharePoint list item or the Value of an item in the colOptionsForChoices collection.

     

    Let’s break it down:

     

    1.

    Selecting from colOptionsForChoices Collection:
    If you want to select an item from the colOptionsForChoices collection, you can directly use the Value property of the collection item. For example:


    UpdateContext({ SelectedLocation: colOptionsForChoices.Selected.Value });

     

     

    2. Selecting from Filtered Locations:
    If you want to select an item from a filtered set of locations (e.g., using Filter(Locations, ...)), you’ll need to specify the condition for filtering. Assuming you have a filter condition (let’s call it LocationFilter), you can do something like this:
    UpdateContext({ SelectedLocation: First(Filter(Locations, LocationFilter)).Title });

     

    Remember to adjust the variable names (SelectedLocation, colOptionsForChoices, Locations, etc.) according to your app’s context.

     

    Let me know if you need further assistance!

  • johnjohnPter Profile Picture
    2,074 Season of Giving Solutions 2025 on at

    @mtsts sorry but what is the relation between my question and your final answer??

  • MTNK Profile Picture
    819 Moderator on at

    @johnjohnPter I am trying to help you. If it does not work for your question, you can try another solution.

  • johnjohnPter Profile Picture
    2,074 Season of Giving Solutions 2025 on at

    @mtsts i think you did not get what i need, this formula does not seems to work:-

     

    colOptionsForChoices.Selected.Value

     

    as colOptionsForChoices is a collection and not a Combobox control!

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