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

Help with a formula to extract data from one Collection into another

I am trying to use a data element from a collection to drive a filter function.  The command I am trying to get to work is the following

 

Filter('[dbo].INV_BASE]', FillmentID=collection.ID)

 

 

- dbo.INV_BASE is a custom entity with a key field of FillmentID

- "collection" is an existing collection with a records that contains a field called ID 

 

The field called ID contains a number

 

I get the blue dot and no data returned.

 

Thanks,

 

todd

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Memorable Member
Memorable Member

Re: Help with a formula to extract data from one Collection into another


@thanke wrote:

thanks again.  Is there anyway to reference a specific data element within a collection within the filter function that doesn't require a button?  the data is in the collection, I just don't know how to reference and pull it directly within a function.


 

Yes, depending on how your data is organized I think you can do it. @CarlosFigueira had an answer in a post earlier that may help:

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Filtering-Items-in-a-gallery/m-p/69044#M28267

 

You can filter the second gallery based on the Selected property of the first gallery. If the tables are related based on the 'CategoryId' column, then you could have this as the Items expression in the second gallery:

Filter(Product, CategoryId = CategoriesGallery.Selected.CategoryId)

 

Hopefully that guides you to a good answer.

View solution in original post

5 REPLIES 5
Highlighted
Memorable Member
Memorable Member

Re: Help with a formula to extract data from one Collection into another


@thanke wrote:

I am trying to use a data element from a collection to drive a filter function.  The command I am trying to get to work is the following

 

Filter('[dbo].INV_BASE]', FillmentID=collection.ID)

 

 

- dbo.INV_BASE is a custom entity with a key field of FillmentID

- "collection" is an existing collection with a records that contains a field called ID 

 

The field called ID contains a number

 

I get the blue dot and no data returned.

 

Thanks,

 

todd

 


 

collection.ID needs to be a single item to compare to using =

 

The method you are using currently probably says in the blue dot exactly why it doesn't work, can you provide that information? My guess is something similar to it not being a single item.

Highlighted
Helper I
Helper I

Re: Help with a formula to extract data from one Collection into another

thanks.  How do I pull a single item from a collection?

Highlighted
Memorable Member
Memorable Member

Re: Help with a formula to extract data from one Collection into another


@thanke wrote:

thanks.  How do I pull a single item from a collection?


 

Maybe use a button in the gallery/card to store the specific item in a variable. You can use the the OnSelect property of the button to assign that items ID to a variable.

 

Something like: 

 

UpdateContext({IDSelected: ThisItem.ID})

Then you can use your filter like:

 

Filter('[dbo].[INV_BASE]', FillmentID=IDSelected)

 

Highlighted
Helper I
Helper I

Re: Help with a formula to extract data from one Collection into another

thanks again.  Is there anyway to reference a specific data element within a collection within the filter function that doesn't require a button?  the data is in the collection, I just don't know how to reference and pull it directly within a function.

Highlighted
Memorable Member
Memorable Member

Re: Help with a formula to extract data from one Collection into another


@thanke wrote:

thanks again.  Is there anyway to reference a specific data element within a collection within the filter function that doesn't require a button?  the data is in the collection, I just don't know how to reference and pull it directly within a function.


 

Yes, depending on how your data is organized I think you can do it. @CarlosFigueira had an answer in a post earlier that may help:

 

https://powerusers.microsoft.com/t5/PowerApps-Forum/Filtering-Items-in-a-gallery/m-p/69044#M28267

 

You can filter the second gallery based on the Selected property of the first gallery. If the tables are related based on the 'CategoryId' column, then you could have this as the Items expression in the second gallery:

Filter(Product, CategoryId = CategoriesGallery.Selected.CategoryId)

 

Hopefully that guides you to a good answer.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (8,727)