Raphael Walters
Raphael Walters8mo ago

Problems filtering Supabase table

Hi everyone! I am having problems figuring out the precise way to format filters when making a Supabase call. If anyone knows how to resolve this your help would be greatly appreciated! https://www.loom.com/share/f9082393b66c49d589323b47d6566e49?sid=99eca381-8712-46e8-9b08-3b6c9db1d808
Loom
Buildship | How to Filter and Prevent Duplicates in Superbase
In this video, I discuss how to filter and prevent duplicates in Superbase when uploading a CSV file. I demonstrate how to check if a contact already exists in the database using the first name as an example. I also explore different filtering methods and share my challenges in pulling variables from the contact list. If you have any ideas or su...
Solution:
Here is an example workflow you may refer, for loop you can refer to these docs - https://docs.buildship.com/core-nodes/loop
Loop – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.
Jump to solution
11 Replies
Gaurav Chadha
Gaurav Chadha8mo ago
Hi @Raphael Walters, thanks for sharing the video, when using filter with direct text value, no need to add template literals ${}. Use it when referencing via variable.
No description
Raphael Walters
Raphael WaltersOP8mo ago
Thanks @Gaurav Chadha I have now manged to get the individual node to work when testing, but am still having problems when trying to apply it to a variable. Here's a quick update to explain what I mean. https://www.loom.com/share/6f7aac56324f4013bbb153a220522455?sid=bea493d1-c17d-4b6e-bc01-b3769006a848
Loom
Buildship | Update on Node Testing
Hey, just wanted to give you a quick update on the progress I've made with testing the node. I managed to get it to work by using a filter that pulls a specific contact based on the
Raphael Walters
Raphael WaltersOP8mo ago
So I basically need to find a way to filter on the firstname that is part of the item variable I am looping on, if that makes sense?
No description
Gaurav Chadha
Gaurav Chadha8mo ago
I would recommend logging the item value first to ensure that it is coming correct, you can use the log node befor the get row and log the item to confirm. https://docs.buildship.com/logging and view cloud log values.
Raphael Walters
Raphael WaltersOP8mo ago
Ok. Thanks! I will try that and report back.
Raphael Walters
Raphael WaltersOP8mo ago
Ok @Gaurav Chadha Here's a quick update. The Logging node confirms that the list of contacts is being passed through. However, I still haven't managed to be able to get Supabase records based on them matching/being equal to the 'firstname' key of the 'item' variable. https://www.loom.com/share/e9df5e89f68c40d49306ba3a822e080d?sid=298f7c79-2d90-4801-aa74-a824f3b8b7a6
Loom
Buildship | Exploring Concepts and Filtering Contacts
In this video, I discuss the concepts of looping over a list and filtering contacts based on the first name. I demonstrate how I added a log node to the list and pulled the item from the list of contacts. I also explain my goal of filtering the list using the get row module, but I encountered some issues. I ran a test to show the current state o...
Gaurav Chadha
Gaurav Chadha8mo ago
Gotcha, thanks for sharing and testing, The reason it is failing at filtering, is the item you've passed is not returning a single value for first name. Since the item is returning a list of array, you'll require to use the dot notation to reference it, eg: (x)Items[0].firstname, if you want to reference all the name you'll require to make a nested loop. Hope this helps to solve it further.
Raphael Walters
Raphael WaltersOP8mo ago
Nestled loops? Now that right there is some biiiiig words for a nocoder straying into lowcode territory!🤣 Oh and by the way, how did you know that was coming next? 🤣 Thank you so much for your patience. I will go away and experiment and report back (just in case others may find this useful.)
Raphael Walters
Raphael WaltersOP8mo ago
Is this what you mean by a nested loop? I've been trying to figure it out but am going round in circles 🤪
No description
Raphael Walters
Raphael WaltersOP8mo ago
Are there any examples/resources I can use as reference points to try and figure this out?
Solution
Gaurav Chadha
Gaurav Chadha8mo ago
Here is an example workflow you may refer, for loop you can refer to these docs - https://docs.buildship.com/core-nodes/loop
Loop – BuildShip
A unified resource to start building your backend with low-code. Dive into triggers, nodes, and step-by-step guidance to jumpstart your workflow creation.