cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mprice
Helper II
Helper II

Filter Gallery from variable

Hello,

 

I am trying to filter a gallery using a variable that was set after selected an option from another gallery.

 

First I set a variable with the following. Where ThisItem.Campaign is to load the variable with the column called "Campaign" from the selected item in the first gallery.

Set(
gblDisc,
ThisItem.Campaign
);

 

Now in the Items field for the second gallery, I tried the following search function, searching the table K.E.Y.S which has a column called Disciplines (or cr0fd_disciplines):

Search(
'K.E.Y.S',
gblDisc,
"cr0fd_disciplines"
)

 

I also tried, but was getting an error with the "=":

Filter(
'K.E.Y.S',
Disciplines=gblDisc
)

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @mprice ,

It is a Choice field and the correct reference Campaign.Value is what I posted. This is not making a lot of sense to me currently (this should a very simple issue). So if you put 

Set(gblDiscount,ThisItem.Campaign)

and go to View > Variables > Global and look at gblDiscount, what is in there?
Also, what is your Data Source (it is a good idea to post this initially with your question).

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

View solution in original post

12 REPLIES 12
WarrenBelz
Super User
Super User

Hi @mprice ,

What type of fields are Campaign and Disciplines?

Choice fields

WarrenBelz
Super User
Super User

Hi @mprice ,

First one

Set(
   gblDisc,
   ThisItem.Campaign.Value
)

and the other

Filter(
   'K.E.Y.S',
   Disciplines.Value=gblDisc
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

mprice_0-1623378938327.png

 

Hey @mprice where are you setting the variable?

 


Did I answer your question? Mark my post as a solution!

If you like my post please hit the Thumbs Up


Proud to be a Flownaut!


Check out my blog for Power Automate tips,
tricks, and guides
FlowAltDelete





In the initial gallery, in the OnSelect field

@mprice ,

If it a Choice field, then .Value is correct.

If set on the OnSelect of the gallery, ThisItem is correct as long as the value is in the Items of the gallery.

Is there something incorrect in any of the above?

I am using this functin on the OnSelect of the first gallery. I think I may have a misunderstanding of ThisItem. I though it would return which item I selected from the gallery.

mprice_0-1623386490702.png

 

@mprice ,

It will - as long as the Items contain the field Campaign.

For a test, try this - OnSelect

ClearCollect(colItem,ThisItem)

 

Then go to View > Collections > colItem and see what is in Campaign

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,974)