Drop-Down Select Component not Triggering Query/not showing results in Table

So, I've been playing around with the select component for days and I'm truly confused. The query will generally fire correctly in the preview section, but not in the actual table results. I have an event trigger on the table query that says to trigger another (more specific) query when my selection is "Admin" or "Owner". So the main table query is to show all the results and the more specific query will show only results where the user is "admin." Is this not the correct way to go about filtering my table to only show users who are considered "Admin"? I've added images here for context.

Any help would be so appreciated!

Hi @jordan_paperspace, welcome to the community!

I think you need to put the specific query in the table1's Data. That is, use a ternary operation on table1 Data input so you can specify which query.data will be loaded onto table1. Regardless of what event you put on the table, it will still load queryTeamMembership.data since that's the only query you placed in table1.

Probably set table1 Data like this:

{{ roleInput.value = 'Owner' ? queryTeamMembershipOwner.data : queryTeamMembership.data }}

Regards

Hi Jocen,
Thank you for your response. This makes more sense now, however, when I used your strategy, im getting an error that queryTeamMembership is not defined. Are you able to tell what I might be missing?

Screen Shot 2021-08-22 at 10.59.50 PM

Hi @jordan_paperspace. It seems you copied the entire thing and not replaced it with the actual resource name that you have. You named yours with big 'Q' so it should be QueryTeamMembershipOwner.

You can add further like this if you have multiple roles to consider for different queries:

{{ select1.value == 'Owner' ? queryTeamMembershipOwner.data : select1.value == 'Admin' ?QueryTeamMembershipAdmin.data : queryTeamMembership.data }}

Add further as you might have get the gist of it.

Regards

EDIT: made sure ternary operation is in equality and not assigning new value to select1.value.

Wow lol of course, however, once we tried that, we're still unable to get the selection change to trigger/display the query in the table. The QueryTeamMembershipAdmin runs successfully, but it does not display on the table as you can see in the image. We have an event handler (on change) on the selection component (renamed it dropdownRole) and an event handler on the submit button. What else could we be missing? Thank you!

Please see the image here:

Hey Jordan, I believe you will get the results you need by slightly modifying your ternary statement. You currently have
´╗┐dropdownRole.value = 'Owner' etc, but this does not check to see if the values are equal. If you change that (and all subsequent checks) to dropdownRole.value == 'Owner', etc. You should get the behavior that you want. Let me know if that works for you!

1 Like

Yay. It started working! Thank you for your help!