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 / trying to sequence a f...
Power Apps
Answered

trying to sequence a filtered number value from a collection

(1) ShareShare
ReportReport
Posted on by 37

Hi, 

 

I have a collection called colLocs that has multiple locations under column field_1, and each location has multiple house numbers under column field_3 and each house number has a value that is the total number of bays in that certain house under column field_4. I am trying to sequence that value so it will produce a drop down from 1 to that certain value. I have attached a snippet of the collection and the code for the dropdown that I want to display the sequence of that value from. I have tried to put the sequence function in front of my code for that dropdown but no luck. cbLocsNum is the combo box for the house number in field_3 and ddLocations is the dropdown I have for the location name in field_1. Any help with be appreciated!

amallafre_0-1720194155144.png

amallafre_2-1720194392383.png

 

 

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @amallafre - it is difficult to visualise the result you're trying to achieve. Could you "draw" an example (e.g. in Excel) of the output you're trying to achieve and paste it as an image in your reply.

  • amallafre Profile Picture
    37 on at

    amallafre_0-1720208405262.png

    like for a value in field_4 of 14, I would want a drop down/combo box to display 1, 2, 3... to 14. But the code snippet displays a dropdown/combo box of just the number 14. I have tried attaching the Sequence function to the beginning of the code snippet, but the problem is that the data type of 14 is a table i believe, when sequence expects a number. 

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @amallafre - you can leverage the Sequence function here. For example:

     

    Sequence(
     cbLocsNum.Selected.Value,
     1,
     1
    )
  • amallafre Profile Picture
    37 on at

    amallafre_0-1720209359710.png

    Think it wants .Result. But still I am trying to filter cbLocNum (which is a combo box of field_3) and ddLocations (which is a dropdown of field_1) to show the respective field_4 value. then i want to sequence that value like the dropdown example i replied with above.

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @amallafre - a Control like a ComboBox or a Dropdown control returns a Table, and a Table can be made up of more than one column. The contents of that Table are determined by whatever you're using in the Items property of that ComBobox. In your case, there is a column called "Result" in that Table.

     

    I am assuming the "Result" column is a number column. Could you confirm what you have in the Items property of that ComboBox?

  • amallafre Profile Picture
    37 on at

    What i have in the items section is the code snippet i attached in my initial post

  • amallafre Profile Picture
    37 on at

    I understand i can do Sequence(ddBays.SelectedText.Value) (where ddBays is the name of my dropdown displaying the field_4 value) in a separate drop down to accomplish what i want, but i am wishing to accomplish this within the ddBays dropdown

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @amallafre - no, I am asking what you have in the Items property of cbLocsNum.

     

    I have no idea which control that code is referring to.

  • amallafre Profile Picture
    37 on at

    Apologies, here it is

    amallafre_0-1720211131772.png

     

  • Verified answer
    Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @amallafre - ok ignore everything you have already done and let's start from the beginning. 

     

    For the Items property of ddLocations, use:

     

    Sort(
     Distinct(
     colLocs,
     field_1
     ),
     Value,
     SortOrder.Ascending
    )

     

    For the Items property of cbLocsNum, use:

     

    Filter(
     colLocs,
     field_1 = ddLocations.Selected.Value
    )

     

    Set the field properties for this ComboBox to return the field_3.

     

    For the Dropdown control you want to return a sequence in, use:

     

    Sequence(
     LookUp(
     colLocs,
     field_1 = ddLocations.Selected.Value && field_3 = cbLocsNum.Selected.field_3,
     field_4
     ),
     1,
     1
    )

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 381 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 340

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard