Images in Template Store Apps - Urgent Problem!

So it seems all images used in the app have to live in the tables for our app to qualify to the template store.

But what happens if we have a screen that returns no rows from the table?

Like a checkout screen where no order is in checkout or a shopping cart screen where no items have been added yet. This screen cannot get any image from the table because its not connected to any row! we have to place the image link directly on the screen.

How can we add images to these screens in our template store apps?

is really hard to understand what you mean… can you give a specific example?

Hi Uzo

I have a shopping out tab based on the products table.
This tab goes through the rows in the products table and returns the items the user has added to cart.

If the user didn’t add any items to cart (hence no rows returned) it shows an image, no items are in your cart.

but this image cannot live in the database because its not part of any row.

what do you mean cannot live in data base??? that the part i really dont understand

  • I could use an inline list tile layout to place an image saved in another table, but that sounds very unorganized
  • I could also redesign the entire layout and base the entire tab on a different table and put an inline list of the products in cart. but that also is so unorganized.

is that image static or dynamic? meaning it will be a deferent image if any conditions change?

image is static. lets say its the store logo at the top.

ok… you can create a IMAGE type column and upload that image to a first row… than add Single Value column and copy it to all rows… now you have a image to call if any condition will go true to show that image in any row… and if i understand it correctly you don’t want that picture in a data base… so make it in some other table and again call it using single value column… glide logic columns will not appear in GS sheet

Yes but that would require that 1 row at least is returned so that the column value is read.

in many cases, 0 rows are returned to a screen.

(example: a detailed screen from products table that returns if product is in cart = true, will return 0 rows if no products in cart)

in that case, only static things on the page will show like text components with custom text, separators, images with direct URL. but nothing from the columns will show because 0 rows are on the screen. if you go to Glide Layout Editor and on the left you open data tab you will see 0 data showing.

for example the screen in image below. 0 rows. all rows filtered out. so all components on screen are not connected to columns in the screen table.

have a image component that visibility is set to if column empty

wow … i never seen massage like that… i thing you have a empty sheet

cannot have that. there is no row so no column so cannot check if column value is empty. :joy:

there are ways around it but its really really unorganized ways. It just doesn’t make sense to use these ways in a clean simple template just so that an image URL is directly connected and not living in the database.

when you open a new sheet / table always make sure there is a data there… anything… that is not account by any function… what i always do … i have a dummy column and always leave first row empty … and this dummy column i put x, is useful for internal relations and functions in google sheets to be there… in glide … it will be always ignored because have no data to show … but is not empty, so the row ID will be created

Lots of ways you can manage this. Here is one approach I sometimes use.

  • All images are stored in a single column in a dedicated “Images” table
  • In the User Profiles table, create a number of Single Value columns to reference the images
  • You can then use the images anywhere in your app by pointing the source of an image component directly at any of those Single Value columns.

If you have a large number of images the above can become a bit cumbersome, but it works well if you are re-using the same images in different parts of your app.

2 Likes

I also do have an “Images” table where all images are stored. They are actually stored in 1 row rather than 1 column.

But user profiles only help when users are signed in. My app mainly targets guest users that are not signed in.

There are other ways around all this, they just require quite some messy work.

Honestly, we should be able to access any image stored in any table, from any other table without having to make a relation between the 2 tables.
Currently I can do that in a messy way using an inline list. So instead of putting my website logo. I put an inline list of the images table. there is 1 row only there, so it returns that row. and i select the image to be the logo column, I would have the image there. It just doesn’t sound correct for me to follow this procedure.

You could still use the Single Value column approach, and bypass the need for relations and/or inline lists.

Not in my case. My screen is based on 0 rows returned. hence you cannot read a single value column.

the single value column is part of a row. If all rows are filtered out. You cannot read the value in any column.

mm, okay yes I see.
Without knowing too much about your app it’s hard to say what the best approach might be then, but it sounds like you may have painted yourself into a bit of a corner. You might want to consider using a different table as a base for the screen in question (ie. one that doesn’t have zero rows). But again, it’s difficult to say, so I’ll just shut up now :slight_smile:

1 Like

no mate, i’m very thankful for your replies and for your ideas.
I am probably going to go with what you mentioned above. I used that for several other tabs. For example my orders tab is based on a table other than the orders table. Its a 1 row table that allows users to input and track an order.
so i guess i have to do the same for some other tabs to avoid getting 0 rows back after filtering.