# Retreiving URL from Supabase Bucket

**URL:** <https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048>\
**Category:** How do I?\
**Created:** [October 21, 2024, 12:16pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048 "2024-10-21T12:16:37Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![ace](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ace/32/12681_2.png) [@ace](https://community.weweb.io/u/ace)\
**Post date:** [October 21, 2024, 12:16pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/1 "2024-10-21T12:16:37Z")

</div>

Hey folks,

I’m currently working on a site where users are able to upload videos. Right now, with the upload workflow the user is able to upload the file to a bucket in Supabase and then simultaneously create a row in a table in Supabase. I’m trying to add an action in that flow that inserts the url from the bucket into the corresponding row in the table.

I see that similar question has been asked in the past, so apologies if I’m re asking. But, my questions would be

- broadly speaking, is this workflow the correct way to go? (upload file to supabase bucket, simultaneously create row in table with metadata that I want for that user, action to retrieve url from bucket then insert into table for user)
- How do I retreive that URL from the Supabase bucket? I’ve played around with some of the code snippets that I’ve seen here/on Supabase’s website. Alas, I am no coder and havent gotten that to work in the slightest.

thanks a million in advance for any help!

---

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [October 22, 2024, 6:16am UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/3 "2024-10-22T06:16:38Z")

</div>

Welcome, @ace !

First off, is the Supabase bucket public?  
If yes, I would store the URL. If no, I would store the path.

Here I have a Upload, Get a Public URL then Update row (or insert row? depending on what you do)

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/e/e23562b32d1ed3749d66e68eb5dbc3a81c678bfa.png)

If it was a non-public bucket I would use something like this:  
Upload, update row with path; to fetch, get signed URL of row and return the signed URL/change a variable.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/6a967700be37c812861d22cd50934b34da963880.png)

---

<div class="post-metadata">

**Author:** ![ace](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ace/32/12681_2.png) [@ace](https://community.weweb.io/u/ace)\
**Post date:** [October 22, 2024, 10:42am UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/4 "2024-10-22T10:42:34Z")

</div>

thanks @Kawwl ! Yes I do have this workflow setup.

 ![Screenshot 2024-10-22 at 6.42.02 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/b/b141f35a16004fdaff80e40386f520e6a4afa60f.png)

The bucket is public. When I go to ‘storage | retrieve public URL’ there isn’t a way for me to select that information from any type of Supabase bucket item. Not sure if there should be; I only have the attached option

 ![Screenshot 2024-10-22 at 6.40.44 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/a7d5915fdad6fb672abce6bc4cd1bd2784749c74.png)

---

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [October 22, 2024, 12:21pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/5 "2024-10-22T12:21:24Z")

</div>

What you are looking for is here:  
Once you have run the get public URL it will appear in the workflow tab. Then you can get the url value 🙂

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/0/0611fd8b77f5b14cb691ddf51de89cb36d1271aa.png)

---

<div class="post-metadata">

**Author:** ![ace](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ace/32/12681_2.png) [@ace](https://community.weweb.io/u/ace)\
**Post date:** [October 22, 2024, 12:33pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/6 "2024-10-22T12:33:28Z")

</div>

I think we’re getting closer! But still a bit confused. I made a loom linked here [Understanding File Upload Process 👩‍💻 | Loom](https://www.loom.com/share/8e0a269f9f364809bbf8543662bc93d2?sid=4ec75344-e73e-489d-9cb1-73476b1b4cbb)

thanks again for all the help!

---

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [October 22, 2024, 12:43pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/7 "2024-10-22T12:43:17Z")

</div>

No worries!  
You can think about path as folder structure, and you can create it as you see fit. ie:

**bucket/folder/new\_folder/filename.jpeg**

In your workflow, when you want to get public URL you are sending the _path_ to the file:  
“bucketname/folder/filename”.

 ![image](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/5/5944eca7f4815350262cb6c2e8d92dd343f5561b.png)

Here, you want to select fullPath. Once this runs, it will get the Public URL.  
In the next step, you want to go back to Workflow actions, and there it will have returned the URL. (Action 2)

---

<div class="post-metadata">

**Author:** ![Broberto](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/broberto/32/5918_2.png) [@Broberto](https://community.weweb.io/u/Broberto)\
**Post date:** [October 22, 2024, 12:53pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/8 "2024-10-22T12:53:08Z")

</div>

This isn’t the best way, because it could break the sync and you could have orphan images, or rows with corrupted images links. What you probably should do is create a trigger on the image uploaded.  
E.g

```auto
CREATE TRIGGER Insertar_oaprecios
AFTER UPDATE ON storage.objects
FOR EACH row
EXECUTE FUNCTION cargar_oaprecios_desde_json();

```

---

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [October 22, 2024, 12:56pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/9 "2024-10-22T12:56:04Z")

</div>

Yeah, broberto is right. 😅 I sent you on a non-optimal path.  
But its a simple one.

---

<div class="post-metadata">

**Author:** ![ace](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ace/32/12681_2.png) [@ace](https://community.weweb.io/u/ace)\
**Post date:** [October 22, 2024, 1:00pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/10 "2024-10-22T13:00:56Z")

</div>

Thanks @Broberto ! that may be a step 2 for me once I figure out this first way first (still learning lol)

@Kawwl that kinda worked? So now I get a url inserted into my table, but when I click on that url i get a page like this

 ![Screenshot 2024-10-22 at 8.59.38 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/7/764e99ecf01f2c3884a144e8e26df5e3031e9de0.png)

I’m also noticing that the url for a working link from the bucket–one that I’ve manually pasted into the table here at the top–looks different?

 ![Screenshot 2024-10-22 at 9.00.32 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/6/6b0f09121e542ccff29b3586c91d42f45ee951ef.png)

---

<div class="post-metadata">

**Author:** ![Kawwl](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/kawwl/32/14297_2.png) [@Kawwl](https://community.weweb.io/u/Kawwl)\
**Post date:** [October 22, 2024, 1:11pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/11 "2024-10-22T13:11:26Z")

</div>

@ace The top one looks like a signed URL. Are you sure your bucket is public? 🙂  
See if you can go the storage bucket and get the public URL, should be the same.

---

<div class="post-metadata">

**Author:** ![ace](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/ace/32/12681_2.png) [@ace](https://community.weweb.io/u/ace)\
**Post date:** [October 22, 2024, 1:16pm UTC](https://community.weweb.io/t/retreiving-url-from-supabase-bucket/14048/12 "2024-10-22T13:16:21Z")

</div>

@Kawwl Yup nearly positive its public  
 ![Screenshot 2024-10-22 at 9.14.48 AM](https://us1.discourse-cdn.com/flex016/uploads/weweb/original/2X/a/a05553af0130292330e84591ff3b8ad6324e4bfd.png)

when I go into the bucket and grab the url for that video I just uploaded though, it gives me back a URL like the one on the top of my previous comment (A signed URL yes?)
