cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
powerwood
Helper III
Helper III

Combine Text and Filtered Data in a Collection

I am trying to create a collection that includes a list of items from a single column in a filtered Dataverse list and a single line of text, "Base Bid". The goal is to have a list of the Change Order Numbers for a given Job and "Base Bid". 

 

I have two Comboboxes. The first selects the Job No. In that Combobox's OnSelect Property I have the following code:

ClearCollect(colOriginated,"Base Bid", SortByColumns(ShowColumns(Filter('Change Orders','Job No' = ThisItem.'Job No'),"crd93_cono"),"crd93_cono",Descending))

 

Then in the Originated combobox Items property I simply have colOriginated. The Items only show "Base Bid" and do not show any of the Change Orders. 

 

I know I've seen a solution for this in the past, but I cannot find it anywhere. Please help and let me know if you have any questions to help solve this problem.

 

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@powerwood 

Please consider changing your Formula to the following:

ClearCollect(colOriginated,
    {crd93_cono: "Base Bid"},
    SortByColumns(
        Filter('Change Orders',
            'Job No' = ThisItem.'Job No'
        ).crd93_cono,
        "crd93_cono",Descending
    )
)

 

You were adding a "Base Bid" that would be going into a record with a Value column, yet all your other records have a column called crd93_cono

 

You can also spare yourself the overhead of the collection and just set your Items property of your combobox to:

Ungroup(
    Table({items: Table({crd93_cono: "Base Bid"})},
          {items: 
               SortByColumns(
                   Filter('Change Orders',
                      'Job No' = ThisItem.'Job No'
                   ).crd93_cono,
                   "crd93_cono",Descending
                )
          }
    ),
    "items"
)

 

Also...your formula is specifically using ThisItem.'Job No' but yet you stated that you have a first combobox for the selection of the job number.  If that is the case, then you want your formulas to be using the selected job number from the first control...not ThisItem.

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

1 REPLY 1
RandyHayes
Super User
Super User

@powerwood 

Please consider changing your Formula to the following:

ClearCollect(colOriginated,
    {crd93_cono: "Base Bid"},
    SortByColumns(
        Filter('Change Orders',
            'Job No' = ThisItem.'Job No'
        ).crd93_cono,
        "crd93_cono",Descending
    )
)

 

You were adding a "Base Bid" that would be going into a record with a Value column, yet all your other records have a column called crd93_cono

 

You can also spare yourself the overhead of the collection and just set your Items property of your combobox to:

Ungroup(
    Table({items: Table({crd93_cono: "Base Bid"})},
          {items: 
               SortByColumns(
                   Filter('Change Orders',
                      'Job No' = ThisItem.'Job No'
                   ).crd93_cono,
                   "crd93_cono",Descending
                )
          }
    ),
    "items"
)

 

Also...your formula is specifically using ThisItem.'Job No' but yet you stated that you have a first combobox for the selection of the job number.  If that is the case, then you want your formulas to be using the selected job number from the first control...not ThisItem.

 

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (4,101)