Formula help with repeating binding

Hello: I have a list of products and a list of fabrics and I want to be able to see which product is selected and when I click on a button (or the product in a drop down menu) it will take me to a different page where a repeating image container will return all the fabric images that the selected product is available in. For example I have Heat Transfer Vinyl Material in various categories ie. basic, electric, fluorescent, glitter, etc. and each of those can be used on different fabric types. For example: the basic can be used on cotton and polyester, the glitter can be uses on cotton and leather, the fluorescent can be used on cotton, polyester, cotton/polly blend, etc. So I want to be able to display image icons to represent only the fabrics that can be used with a specific vinyl. So currently I have an app variable that contains all my fabric info (fabric name, fabric information, fabric image) I have another app variable that contains the product information (product name, product information, product image. I currently have a formula taking me to a new page when the category is selected and on the new page I have a container that contains a repeating image from a page parameter named fabric_image. How do I make it accurately repeat the icons that match the vinyl that it can be used on? I’m sorry if this is confusing. I’m new to appgyver and not quite up to speed on the lingo. :slight_smile: I think I must have to put a formula in the repeat binding box but I’m not sure what to use. Thanks in advance for any help you can give me.

OK. . . Here’s a formula that kind of works.

SELECT(appVars.Fabric_list, item.htvCategories[0] ===params.category_name)

However, it only works on the first category in my list. If I change the [0] to another number it only works on the category that corresponds to that number. If I leave the [0] out all together it doesn’t work at all. Will I have to create a formula string that will reflect all numbers within brackets? and if so how do I do that? Any thoughts?

Hello Jennifer,
Hope you’ll have a great journey here creating solutions.

So you need to select based on an array of items.

Try this:

SELECT(appVars.Fabric_list, IS_IN_ARRAY(item.htvCategories, params.category_name))

You are now officially my favorite person on the planet!!! That worked!!! I can’t believe it. I’ve been struggling with this for days!! Thank you so much! Thank you for being a part of the AppGyver Community!!

1 Like

I am glad that I could help. Feel free to reach out with any future issues as well. We’ll sort them out. And warm welcome in the Community. :heart:

*Just a quick sidenote. This issue should be labelled as a “question” as “build issues” are to refer to anything that goes wrong after the development is done and You try to transform the project to a final app via the “Launch > Distribute” tabs in the Build service.