Slice to show items included in a given tag

I have a table of artworks and I've created a "collections" page (a slice) that shows any artwork which has been added to a collection, grouped by the collection column. I'm trying to create a way for one artwork to belong to many collections. In other words, how can I create a view that has all of the collections (which are subsets of all the artworks) with all of the following true:

  1. An artwork can have many collections.
  2. An artwork can appear twice; once in each of the collections to which it belongs
  3. Each of the comma-separated values in a "collection" column for the artworks table gets it's own section (e.g. Collection 1, Collection 2) and no section is comprised of more than one collection (e.g. "Collection 1", "Collection 1, Collection 2", "Collection 2").

I've gone back and forth on making these collection pages slices or an actual table. Any pointers on how I would go about accomplishing this?

0 11 599
11 REPLIES 11

In a situation like you have, I usually create a many to many relations table to capture the relations you need to model. ENUMLISTs are OK but not easy to process and manipulate sometimes. You can create ENUMLIST like VCs if you want using the relationships captured in the m2m table.

TeeSee1_2-1700741717363.png

 

TeeSee1_0-1700741649116.pngTeeSee1_1-1700741675797.png

TeeSee1_3-1700742077882.png

Thanks for this pointer. I watched a video to try and understand how to do this, and it seemed to lead me down a good path, but now I can't figure out how to get my images to show up under a tag. This other forum post seems to get me almost there, but I can't quite figure out what I'm doing wrong. I can get the Artwork IDs to show up under a tag, but I can't figure out how to get the images to show up.

_pete__0-1701235708139.png

_pete__1-1701235746241.png

 

 

Apparently your structure is not the same as mine. But at least I get what, I believe, you are looking for.

TeeSee1_0-1701244194751.pngTeeSee1_1-1701244227665.png

 

This is helpful; thanks. What are the precise steps for including a set of rows from another table under the details for a given row, like you have above? Also trying to figure out how I can make this look like an image gallery instead of table. Thank you for your insights.

1) I just used the system generated "Related xxs" inline table. Nothing special.

2) Set the inline view to gallery.

TeeSee1_0-1701319579424.png

 

That's very helpful; thanks! I've been around the internet trying to actually understand what referencing is, dereferencing, virtual columns, slices, etc. and am really pretty jumbled up on referencing at this point. I've read the docs several times, watched a number of videos, read various articles, and have even successfully implemented ref columns in several of my apps, but I'm somehow still foggy on how this is actually supposed to work. In your case, do you just have three tables: artworks, collections, and the m2m one? When you say "the system-generated 'Related xxs' table", do you mean that you took steps something like the following?...

  1. Create three tables in some spreadsheet editor, like Google Sheets
  2. Ensure that columns like 'artwork' and 'collection' exist in each of the tables, but make each table have it's own unique key.
  3. Generate an app from these tables and the REF_ROWS and virtual columns get created automatically

Thanks for your patience in walking me through this!

The first step is correct. Make three tables, like three sheets in a Google spreadsheet.

artworks and collections tables have a unique key.

The m2m has two fields of type ref in the spreadsheet, each referencing artworks and collection. Create a third column as a VC with an app formula simply concatenating the two ref columns and make this VC the key of the table. I also created  another VC with [ref to artwork].[image column] so I can display the picture in a detail view of collections.

"Related xxxs' (REF_ROWS()) are automatically created in the tables that are referenced, in our case both artworks and collections. In a detail view of the collections, you should see an automatically created inline view of the m2m. Since the m2m has a vc that contains the image of the artworks, by making this inline view gallery, you can display the images.

Hope this explains what I have done in more detail.

@TeeSee1 I very much appreciate you sticking with me. I think I've got things set up the way you mention (will include screenshots below), but I'm stuck on a couple things:

  1. How to allow multiple tags (formerly "collections", apologies for any confusion this creates!) on an artwork
  2. How is the Relationships table getting used (or not). Is there something I should set up differently so that the artworks will appear in that "Related xxxs" column?

Here's what I mean:

Screenshot 2023-12-01 at 11.43.27 AM.pngScreenshot 2023-12-01 at 11.42.47 AM.png

Here's what I have:

Screenshot 2023-12-01 at 11.42.01 AM.pngScreenshot 2023-12-01 at 11.42.00 AM.pngScreenshot 2023-12-01 at 11.41.57 AM.png

Screenshot 2023-12-01 at 11.42.35 AM.pngScreenshot 2023-12-01 at 11.42.31 AM.pngScreenshot 2023-12-01 at 11.42.21 AM.png

 

 

 

 

Ah, I think I have it working now, except for the part about multi-selecting tags. On the three-table subject, I had failed to input any sample data in the third table, but once I input sample data (following instructions in this post, specifically those from @Phil ) then Appsheet started to figure out the connections correctly. Thanks again for all the help!

You do not put any tags in the artwork table. The relationships between the artworks and the tags go into the m2m table!

Thanks for all your help with this. After several more tries using a third table, I ended up going with the enumlist method (two tables). I have no doubt your method works, but I had trouble getting multiple tags to associate with a single artwork. Thanks again for the help.

Top Labels in this Space