Hello,
I have a gallery which is pulling from two tables worker address and workers (parent table) - I want to just show the active users in the gallery are pulling from the workers table.
My current view has both active and inactive users, and I currently have a search filter set like this: so that I can search via users names. However, where would I add the status in this formula to only show active users in the gallery?
Filter('Worker Addresses', StartsWith('Worker (cdm_WorkerId)'.'Full Name', TextSearchBox1.Text))
Thank you,
Henry
Hi Henry,
Are you using Dataverse as your datasource?
Please add a second condition to your filter on your status column
You'd be looking at something like filter (tablename, status (tablename) = status (tablename).active)
If I understand correctly you want to filter where the parent record has an active status, for this do:
Filter (childtablename, childtablename.parenttablename.status (parenttablename).status = (parenttablename). active)
Please refer to this great video from Reza Doranni that details working with choice columns
Hi @SBax ,
Thank you for the swift reply. I watched Reza's video but he only goes into detail around filter from one table and not two like I have.
Sorry if I am missing something. Im having trouble with the formula you provided: For example if input what you used - Filter (childtablename, childtablename.parenttablename. I am unable to pull the status??
Im unable to pull the status like this either:
Or...fails as well
The two tables are worker addresses and worker (parent) and the workerid is the column that sits as the key relationship between the two tables allowing me to pull the status from the parent table.
Appreciate your help.
Thank you,
Henry
I'll be at my desk in around 30 minutes, will have a look then and pull something together using contact and account to demo this.
Can I just confirm, is there a 1:N relationship between worker address and worker?
No problem, I should be able to replicate this with account and contact when I'm at my desk. Leave it with me. I'll be in touch shortly
Ok, I dont have an exact formula, but wanted to share what I am working on
my proposal is to create a collection in the OnStart property of your app, containing the worker addresses
next step would be to use add columns to add a column to this collection to hold the staatus from the parent worker
the resulting collection would be our items for the gallery, and we could do a simple filter on that.
I'm not sure of the exact details behind the add columns part, but that should give you what you need.
Have a look into that, and I'll check back later to see you how are progressing
Hi @SBax ,
Did some research around this: I found this article - https://www.c-sharpcorner.com/article/perform-join-in-powerapps-collection/
Unsure how relevant it is to what we want, but it seems to be along the lines.
The article has the employeeID as the key relationships which is very similar to my two tables which is a 1 to many relationship with the workerid being the column that both tables have.
I can pull the worker id from the worker table - but for some reason I can't pull the workerid from the worker address table? it only allows me to pull the workerid from the worker table......see below:
Regards,
Henry
User | Count |
---|---|
256 | |
106 | |
86 | |
51 | |
43 |