[Need Help] Can show one image from a list, but not full list

Ok, so it turns out this is (slightly) more complicated than it should be, as you can’t convert a single image to a list, like you can with most other types of data for some reason.

So you need to define an empty list of images somewhere first (in a custom state).

In any case it’s still very simple… here is the outline of what you ned to do.

Create a custom state list of type Image and leave it empty.

Then just add your RG, and set its content type to Image, and its datasource to the empty custom state list of images, plus item (Book’s Main image) merged with (Book’s Other Images).

Here’s an example: Book Images (bubbleapps.io)

1 Like

It’s actually a list of images. I just uploaded the same image three times. :blush: Sorry for the confusion. :man_facepalming:t2:

1 Like

This is exactly what I did in the example for you. :blush: I just updated the images for you so you can see that they are three different images in a list.

Please look at it again. It’s what you are looking for: [Need Help] Can show one image from a list, but not full list - #10 by J805

1 Like

Hi Adam, thanks for this, so I have managed to replicate it, and I think I am understanding the logic behind it:

  1. By creating an empty list custum state, I am putting a list onto the page that I can refer back to and add things to.

2.1) A Repeating Group can only be filled with a list.
2.2) If filled with other than a list, it will repeat the single item over and over.
2.3) If I try to fill it with both a list and a non list, it throws a hissy fit and doesn’t work.
2.4) In order to get it to fill with both a list and a single item, I must first make the single item into a list classification as well.

3.1) By adding the main (i.e. single) image to the empty list, I can now add another list to it (i.e. the list of other images). The single image and the list of images merge together to be one bigger list.
3.2) The Current cell’s image in the Repeating Group can then refer to that list and be happy.

Is this a correct interpretation of why this works?

Thanks, A

Hi Jason, yes, that is what I am trying to achieve, and I have managed to imitate that too. I don’t know how to post both as solutions - we have 4 now (only two of which are elegant!)

If I try to explain what you did as I understand it:
As above,
2.1) A Repeating Group can only be filled with a list.
2.2) If filled with other than a list, it will repeat the single item over and over.
2.3) If I try to fill it with both a list and a non list, it throws a hissy fit and doesn’t work.

4.1) Converting the book itself to a list and making it a list of each item’s logo, makes the logo a list with one item in it? (This is slightly confusing to me)
4.2) The List of images also must be converted to a list before it can be merged with another list (I tried it without converting it to a list and it stilled worked, does converting it to a list do other things that are important as well?)
4.3) Merging the list of Each Item’s Logo to the list of images allows the merged list to become one.
4.4) The Current cell’s image in the Repeating Group can then refer to that list and be happy.

  1. No custom state is required inthis method.

Is this correct?

Thanks, A

Is this a correct interpretation of why this works?

Yep, that’s a pretty good overview.

1 Like

As they say in Yorkshire, Champion! Thanks again

1 Like

Hey @StandUp

Most of what you said seems correct. The only thing is this part that I noticed. Unless I read something wrong.

A repeating group must always have a list. It won’t repeat the same item if it’s not not a list, it will just error because it’s not a list.

Hope that makes sense. Glad you have plenty of solutions. :blush::raised_hands:

2 Likes

Yes indeed, and thanks again!

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.