Filter a Table by Array instead of Single Value

Hey Gio,

Is there a way to filter an interactive table by an array rather than a single value?

Basically, I am building a training manager app and I am building a slide to assign a specific training to a user. I’d like to filter the user selection table so that it only shows users that do not have that specific training scheduled already. I built a connector that outputs an array of users that already have that specific training scheduled, but don’t know how to apply that output to a table.

For example…

I have Table 1 that generates ID’s using the expression [User Name] + [Training ID].

In Table 1, I have a field for the [User Name], [Training ID], and [Status].

I built Connector 1 that creates an array of [User Names] for the [Training ID] selected in the app that has the [Status] = “Currently Assigned”. I’ve created a text variable array named “Duplicate Training Users” which stores the Connector output.

I have Table 2 which is made up of all the Users added to this training manager app.

In the selection screen of the app, I’ve embedded Table 2, but would like to filter the table so that the [User Name] of Table 2 does not contain any of the [User Names] in the “Duplicate Training Users” text variable array.

Is there anyway to do this?

Thanks!

Eric

hey @Esinger5, sounds like an awesome app you’re building!!

to answer your question, Interactive Tables cannot be filtered by an Array (the Variable type must match the Variable Column Type being used in the Filter).

have you attempted to assign the output of the connector function directly to the interactive Table, rather than using it as a filter??

if you get an Array of Objects returned from a Connector:

they can be assigned directly to an interactive Table as the Datasource by selecting Variable instead of Tulip Table:

does this help you build what you’re trying to?? let me know!!

gio

Hey Gio,

I’ve already explored the option you mentioned above. The issue is that I can only output users who have that training already scheduled, not the inverse.

So the hard part is basically querying two tables together using one field as a filter for the other table.

Can this be done inside of a connector?

It would be great for the connector inputs to have an array option like the outputs do or allow two table sources within one connector.

No matter how I try to think through it, I still get stuck on the issue of comparing two data sets. Depending on how I go about it, it still gives me the same issue whether it’s during the connector builds or whether it’s during my triggers or whether it’s within filtering interactive tables.

Maybe we could discuss this in a follow-up session with either you and/or Eddy.

Thanks Gio

hey @Esinger5, I think a quick call would indeed be useful to continue to understand the requirements here. I have sent you a direct message to schedule some time, speak soon!!

gio

Hello Eric and Gio
I’m trying something really similar : An operator use a multi select widget and create a text array of id. This list of id should then be used to display an embedded table with other related fields.
I’m a bit stuck there :sweat_smile: Did you overcome this obstacle before ? Thanks by advance :slight_smile:

hello @pte!! assuming the list in your Multiselect is a static list, you can convert all items in the Array to Strings and use those in the filter (paying attention to make the filter Any).

Multiselect:

Array > Strings

Filter on the Table:

resulting App:

if the list is not static, you can use the Table API. let me know if this helps!!

1 Like

Hello Gio, yes it’s not static :sweat_smile: would be great to understand how to do it with the Table API :slight_smile:

hello @pte, OK not a problem!!

we’ll be covering Table API in this week’s Office Hours, can you make it on Friday?? if not, I can send you the recording.

also, this Support Article: How to Use the Table API | Tulip Help Center - Support for Building Manufacturing Apps has a detailed walkthrough on how to use the Table API.