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

Sort by column

Hi,

 

I have a list box which uses looksups and filters, and I want to sort it by a column in vMapping called item_order. I'm just not sure how to add that into the formula.

 

Can anyone help please?

 

Filter(vItem, crb20_item_id in Filter(vMapping, Linked_Package in ComboBox2_3.SelectedItems.crb20_package_id && Linked_Module = LookUp(vModule, crb20_module = Label1.Text).crb20_module_id).Linked_Item)

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @Kathryn_Marie ,

Could you please share a bit more about the error message within your formula?

Does the "item_order" column exists in your vMapping data source rather than vItem data source?

 

If the "item_order" column only exists in your vMapping data source rather than vItem data source, I think there is something wrong with your formula.

 

I have made a test on my side, please consider take a try with the following workaround:

SortByColumns(
              AddColumns(
                Filter(
                      vItem, 
                      crb20_item_id in Filter(
                                               vMapping, 
                                               Linked_Package in ComboBox2_3.SelectedItems.crb20_package_id && Linked_Module = LookUp(vModule, crb20_module = Label1.Text, crb20_module_id).Linked_Item
                ),
                "Item Order",
                LookUp(vMapping, Linked_Item = crb20_item_id, 'item order')
              )
              "Item Order", 
              Ascending
)

Note: I assume that the "item_order" column only exists in your vMapping data source rather than vItem data source

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Highlighted
Super User II
Super User II

Have you tried disambiguation? Something like

 

SortByColumns( -- your above formula here -- , vMapping[@item_order], Ascending)

Highlighted

I've tried a few variations of this, but I am getting the message "Invalid argument type (Table). Expecting a text value instead." I have this at the moment:

 

SortByColumns(
Filter(vItem, crb20_item_id in Filter(vMapping, Linked_Package in ComboBox2_3.SelectedItems.crb20_package_id && Linked_Module = LookUp(vModule, crb20_module = Label1.Text).crb20_module_id).Linked_Item), vMapping[@cr330_item_order], Ascending)

 

I have also tried:

SortByColumns(
Filter(vItem, crb20_item_id in Filter(vMapping, Linked_Package in ComboBox2_3.SelectedItems.crb20_package_id && Linked_Module = LookUp(vModule, crb20_module = Label1.Text).crb20_module_id).Linked_Item), "crb20_item_order", Ascending)

Highlighted

Hi @Kathryn_Marie ,

Could you please share a bit more about the error message within your formula?

Does the "item_order" column exists in your vMapping data source rather than vItem data source?

 

If the "item_order" column only exists in your vMapping data source rather than vItem data source, I think there is something wrong with your formula.

 

I have made a test on my side, please consider take a try with the following workaround:

SortByColumns(
              AddColumns(
                Filter(
                      vItem, 
                      crb20_item_id in Filter(
                                               vMapping, 
                                               Linked_Package in ComboBox2_3.SelectedItems.crb20_package_id && Linked_Module = LookUp(vModule, crb20_module = Label1.Text, crb20_module_id).Linked_Item
                ),
                "Item Order",
                LookUp(vMapping, Linked_Item = crb20_item_id, 'item order')
              )
              "Item Order", 
              Ascending
)

Note: I assume that the "item_order" column only exists in your vMapping data source rather than vItem data source

 

Please consider take a try with above solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Highlighted

I'm getting the message 'Invalid schema, expected a one column table'. I also think I'm missing a bracket somewhere.

 

Yes, "Item_order" column only exists in the vMapping data source rather than vItem data source. 

 

Thanks

 

Highlighted

Hi @Kathryn_Marie ,

Could you please share more details about the error message within your formula?

Could you please share a screenshot about it?

 

Based on the needs that you mentioned, I think the solution provided above could achieve your needs. Please cnosider set the Items property of the Gallery to above formula I provided, check if the issue is solved.

 

Please consider provide a screenshot about this issue, so we could track this issue and provide a solution for you.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted

I had to tweak it a little, but ultimately this solution worked! 

 

Thank you.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (9,320)