I want to connect two or more different Slack acco...
# ask-ai
t
I want to connect two or more different Slack accounts to a destination, how can i differentiate data between these accounts? it looks like airbyte dumps every data in the same database @kapa.ai
k
To differentiate data from multiple Slack accounts when syncing to the same destination in Airbyte, you should use the Stream prefix or namespace feature for each connection. Airbyte requires that each connection syncing to the same destination must have unique stream identifiers—either by prefix or namespace—so that data from different Slack accounts does not get written to the same tables and cause conflicts or data loss. Here's how you can do it: 1. Set up a separate Airbyte connection for each Slack account. 2. For each connection, go to the Schema tab and set a unique Stream prefix (e.g.,
slack_account1_
,
slack_account2_
). This will prepend the prefix to each stream/table name in your destination, making it easy to distinguish which data came from which Slack account. 3. Alternatively, you can use unique namespaces for each connection if your destination supports it. This approach is now mandatory in Airbyte 1.6 and later, as Airbyte no longer allows multiple connections to write to the same destination stream without unique identifiers. If you want to combine the data from multiple Slack accounts into a single table, you should do so downstream in your database after Airbyte has synced the data into separate tables or namespaces for each account [Configuring Schemas](https://docs.airbyte.com/platform/using-airbyte/configuring-schema), [Release Notes 1.6](https://docs.airbyte.com/release_notes/v-1.6#unique-stream-prefixes-or-namespaces-are-now-mandatory). Summary: - Use a unique stream prefix or namespace for each Slack connection. - This keeps data from each Slack account in separate tables. - Combine data downstream if needed. This ensures your data remains organized and prevents accidental overwrites or data loss.
t
so how do I fetch data for a particular slack account to use after connection? @kapa.ai
k
A message from kapa.ai
To fetch data for a particular Slack account after setting up multiple connections in Airbyte, you should query the tables or schemas in your destination that correspond to the unique stream prefix or namespace you assigned to that Slack account's connection. For example, if you set the stream prefix as
slack_account1_
for the first Slack connection, all tables for that account will be named like
slack_account1_users
,
slack_account1_channels
, etc. To fetch data for that account, simply query those tables in your database. If you used unique namespaces instead, query the tables within the namespace/schema that matches the Slack account. Example (Postgres):
Copy code
sql SELECT * FROM slack_account1_users;
or, if using namespaces:
Copy code
sql SELECT * FROM slack_account1.users;
This approach ensures you can easily identify and fetch data for each Slack account separately, as each account's data is stored in its own set of tables or schema, based on the prefix or namespace you configured during connection setup. This is the recommended and supported way to differentiate and access data from multiple Slack accounts in Airbyte [Configuring Schemas](https://docs.airbyte.com/platform/using-airbyte/configuring-schema). If you need to combine data from multiple accounts, you can do so with SQL queries downstream in your destination database.