How to reference array values in another table?

Hi!

I’m setting up integrations as data sources, and my users will create their own workflows for these integrations. I’d like to create for each integration separate actions (based on the integration’s api).

In table 1 called “integrations”, I made a jsonb array field for “actions”
This field would contain an array of values like [“get_calls”,“get_users”].

Table 2 called “integration_workflows” should have a field to reference what type of action the workflow should have.

Is it possible to somehow make a reference in “integration_workflows” to what action the record is related to, in the array of actions in “integrations”?

A reference type is always a pointer to an ID of a row

In this case, it would be “action_id”, which would point to a table “actions” - which you seem you don’t have because you’re puting actions in a JsonB column in table “integrations”

So, you’re left with “integration_id” reference

1 Like

Ohh yes I could just do another “actions” table. Sometimes I make simple things too complicated. Thanks!