Skip to main content
← Data, API & Backend
Data, API & Backend October 20, 2022 · 3 replies

How can I show just the user content?

Archived from the Bravo community forum (2021–2026). Some answers may refer to older versions of Bravo.

Hello community!
I need your help again 🙂

Well, I ve a table (lets call it USER_PROFILE_TABLE) where I store the users data (id and name) after the onboarding process. 
I ve another table (lets call it PRODUCTS_TABLE) where I store the products data (id, name, description, price, image).
After the user buy an specific product, I record, in a third table (lets call it USERXPRODUCT_TABLE), the user id and the product id that he/she chooses. In that way I can know which products a specific user had bought.

That said, I want that the user whos logged in can see just the products he/she had bought. 
How can I do that?
I know that I have to have an API Get List to get the list of products and the list of produts related to an specific user, but once the bought products by the user are in one table and de products details are in another one, how can I do that?

3 replies

Valter October 20, 2022

On the GET request use the filterByFormula {airtable colum with the user id} = '${user.id}

Nadja October 21, 2022

Thanks for your answer Valter! 🙂
But that solves just part of the problem, right? I mean, I could get the products IDs related to a specific user, that is in the table USERXPRODUCT_TABLE, but once having that, how can I filter in the PRODUCTS_TABLE just the products from that list of products ids? Is it possible to send an array of products ids in a FilterByFormula or something? And how to mention the result of a table in the Get request of another table? 🤔

Nadja November 3, 2022

I couldn't make it works yet 😟
Now I'm trying another way.. I tested using a multiple select or a linked field where I have all users id related to a product, but the problem is that when I update that field to agregate a new user id, the value is overrided instead of concatenated, even if I use the typecast parameter. What I should do different on my JSON code to make it get all users id that already are in that field and agregate the new id that Im sending through the variable ${user.id} ? 

My JSON code in the PATCH request API looks like:
{
“records”:
[
{
“id”: “${record_mimo_id}”,
“fields”:
{
“Who has access”: [“${user.id}”]
}
}
],
“typecast”: true
}

Does anyone can help please?

Wrote something in this thread and want it removed? Request removal

Still stuck?

Ask the community on Discord

This archive is read-only. New questions, office hours and product updates now happen in the Bravo Discord.

Join the Discord