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
)
Solved! Go to Solution.
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.
Choice fields
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.
Hey @mprice where are you setting the variable?
Proud to be a Flownaut!
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 ,
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
183 | |
46 | |
46 | |
34 | |
33 |
User | Count |
---|---|
254 | |
82 | |
78 | |
67 | |
65 |