Hi araelius86,
Can you confirm what the content of the vairable is once you've pushed the button? (Use the Variables option under View menu).
Distinct returns a table with a single column by default titled "Result".
If you Set(variable, ThisItem) then the variable is likely to be a row of data (again, even if it's only one column it's still constructed as a row).
Constructed as above, to access the value I suspect you might need to use variable.Result
To filter another gallery with the same data by the variable you would set the Items to
Filter('Customer Services Branch Phone List', Department=variable.Result)
Alternatively, you could change your Set() function to
Set(variable, Thisitem.Result)
in which case you can access the value just by using variable.
Filter('Customer Services Branch Phone List', Department=variable)That said, you can simply use the Gallery.Selected option and avoid the variable entirely (although if you plan to use it elsewhere in your app you may still want it). This assumes your buttons for each row are actually inside the gallery card and not outside.
For this, just set the button to
Navigate(NameList, Fade)
And in the Items property of the second gallery
Filter('Customer Services Branch Phone List', Department=Gallery1.Selected.Result)
Hope this helps 🙂
Kind regards
RT