How to get data from other tables #1325
-
|
I am trying to run a formula on a column in one table using fields from another column in a different table. How can I get access to the data in that column in the other table? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Hey @jairiza, you could use the Derivative field type to achieve this. Derivative fields have access to parameters that can access your data on Firestore (check out our docs to know more: https://docs.rowy.io/field-types/derivative#api). The following code snippet demonstrates fetching data from a "users" collection in your Firestore database. const derivative = async ({ rrow, ref, db, storage, auth }) => {
// Get user doc
const userDoc = await db.collection("users").doc(row.uid).get(); // matches the uid column in this table to the Document ID in users collection
return userDoc.get("email");
};
export default derivative;
|
Beta Was this translation helpful? Give feedback.
Hey @jairiza, you could use the Derivative field type to achieve this. Derivative fields have access to parameters that can access your data on Firestore (check out our docs to know more: https://docs.rowy.io/field-types/derivative#api).
The following code snippet demonstrates fetching data from a "users" collection in your Firestore database.