cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous ,

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 @Anonymous ,

What type of fields are Campaign and Disciplines?

Anonymous
Not applicable

Choice fields

WarrenBelz
Super User
Super User

Hi @Anonymous ,

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.

Anonymous
Not applicable

mprice_0-1623378938327.png

 

Hey @Anonymous 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





Anonymous
Not applicable

In the initial gallery, in the OnSelect field

@Anonymous ,

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?

Anonymous
Not applicable

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

 

@Anonymous ,

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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,432)