Show Conditional Based on Yes/No in Database Search

Hey, there.

I’m attempting to show a shape, conditionally on if it has a certain file extension. For example, the shape should show if it’s an image (contains .png, .jpg, .gif, etc.).

Instead of setting up a conditional for each of these file types on the shape, I created a dataset that is titled “File Types” with two fields. One is “extension”, one is “type.”

I added three rows in this dataset.

  • .png extension, type image.
  • .gif extension, type image.
  • .jpg extension, type image.

Now, I’m struggling to set a single conditional on the shape that does display it if the file extension contains one of the type = image since it just returns a list. Is there a yes / no I can add to this? Screenshot below.

Thanks in advance!

Suggestion for part of the logic.

Set a group in a hidden popup to be of type yes/no. Call it “Does add doc contain file type?”

Run your search to have the count be > 0

This will get you your first yes or no. Running the search on page load (which will happen every time since Bubble loads all popups to the browser) should get you this answer in a more performant way than having it be part of a conditional statement.

After that combine “Does add doc contain file type?” with your other is not empty expression (add document file aws is not empty)

1 Like