New user...help me make a music lyrics DB!

I just started trying to learn Coda in earnest and have watched many tutorial videos and part of Paul’s getting started videos. But I need a project to make it click and am having trouble with things that seem basic.

The Project
I’ve started making a music journal of sorts. The purpose is for me to keep track of songs I hear and want to learn to play on various instruments. I also want a quick lookup feature so I can quickly search by various attributes. Here is the structure I want:

Songs table

  1. Title (Text)
  2. Band (Table lookup)
  3. Lyrics (Canvas)
  4. Instrument (Table lookup)
  5. Spotify - track (Pack)

Bands table

  1. Name (Text)
  2. Artist (Table lookup)
  3. Songs (Table lookup)

I need at least the basic version below, but would love help to take it to the next level or two.

BASIC
Why does my Bands table not filter but show all songs in the songs table when I use the following column formula? And why is there an @ symbol at the beginning?

Songs.Filter(thisRow).BulletedList()

I also tried:

Songs.Filter(Band.Contains(thisRow))

Also, I’m not sure if I should keep the Songs table on its own page and create another simpler lookup page with all the filters, but it appears I would have to duplicate the table there anyway? Any advice on how to structure the doc?

LEVEL 1
Is it possible to pass my song title and Band name through the Spotify pack and create a link to play the song? I tried adding Spotify - Track, but don’t see documentation about what to do beyond that except high level stuff.

LEVEL 2
The tough part is between Bands and Artists. Sometimes a single person is the author of the song, and sometimes a Band is the easiest way to see it. I play regular songs, but also play old time music. In that community, you really reference by “tune” rather than “song” but more importantly you reference the author of the tune instead of the band. So someone might say “I play the Clarence Ashley version of Coo-coo.”

I’m not sure how to best organize this. But I started by separating out Artist from Band and nesting Artist inside the Band table. But then I don’t know what to do in Songs except include both. But then I have blanks in data.


I’ve shared the doc and I believe you can edit the formulas. (Or does edit only allow you to add records in tables?)

Any help is appreciated!

1 Like

Hi @Paul_Reid :blush: !

Ok so… Let’s do this :blush:

This is because you used BulletedList()within a LookUp type of field… :blush: . So there’s some “display” data conflict going on here (as bullet lists are not supported within lookup field… the field can’t interpret it correctly)

As for the formula, it doesn’t filter anything because you didn’t precise what you’re looking for :blush: (so the filter returns all songs from your Songs table for each bands)… This formula should do the trick :blush: :

Songs.Filter(Band = thisRow)

where Band is effectively CurrentValue.Band :blush:

And what it does is it takes your table Songs and look for (Filter()) the songs where the Band is equal to the value you’ve entered in the display column of your Bands table :blush: .

The CurrentValue.Band is important as Filter(), behind the curtain, takes the whole a list of rows in your table (it’s actually what a table is: a List of Rows) and keeps from that list what you ask it to keep (in this case, CurrentValue.Band = thisRow)

OR

If you wish to display that list as a .BulletedList(), you can do so but in a Text field :blush: :

Songs.Filter(Band = thisRow).BulletedList()

(I’ve added a Text field Copy of Songs in your Songs table where the songs are displayed as a BulletedList() and corrected your Songs Lookup so you could see the difference :blush: )

The @ before each songs in the BulletedList() is literally there to indicate that’s it’s a row reference (i.e.: a link to a row in a table and in this case, a link to a song in your Songs Table :blush: )

TBH, I’m not sure how to guide you here :thinking:

If I was to create such a doc, I guess I would go with “classical” way :

  1. A base table for the songs with all the info/formulas I wish and because this could get messy really fast :
    1.1. A clean “display” view of that base table which I would use to filter, search and alike …

I would probably do the same for band/artist …

I think I would put everything into one table and categorise/give a “role” to each person/group in that table (by creating and using “role” lookup table… so if needed it could also be filtered later)…

E.g.: :point_down: :blush:

After that, how you choose to link a band and/or solo artist to a particular song is up to you as a LookUp field can either be a single select or a mutli-select… :innocent: :

In my quick sample above, each artist should have their own rows, each bands should have their own rows too and as sometimes in music you have “Artist X & Band Z” as interprets of a song, those should also have their own rows…
But that’s not an obligation as if you use a multi-select Lookup field, you could just creates rows for solo artist, rows for bands and if you stumble upon a “Artist X & Band Z” song, simply select the concerned artist and band in your Lookup :blush: .

But it might not work for you :blush: … I mean, I personally now tend to create this kind of setup (big tables + smaller “Display” views) as it’s generally the simplest/easiest regarding formulas and such and then refactor/refine if necessary… But it really depends on the use case scenario :innocent:

Concerning the Spotify pack, I don’t use it (as I don’t use Spotify) but from the documentation, it doesn’t seem to work like the Wikipedia Pack where you can effectively search for “page whatever” and get the info back…

You could apparently search by Spotify Album ID and potentially get info back but I don’t see anything concerning which info you could get this way …

Edit: Corrected mistakes I made earlier :innocent:

5 Likes

@Pch, thank you! Your comments and explanations were all very helpful. (I might merge Artists and Bands into one table with Rules, but still there would be no hierarchy.)

I’ve added a view for the Songs table on a dedicated “Search” page and am trying to filter the table there with a series of interactive filters, but I’m also running into formula challenges there. These are the controls:

  • Search
  • Instrument
  • Genre
  • Key
  • Difficulty

In plain English, I would express the logic like this:

When I type a value in Search box, filter EITHER the Title OR Band
AND
If Instrument is set, filter by that value
AND
If Genre is set, filter by that value
AND
If Key is set, filter by that value
AND
If Difficulty is set, filter by that at least that value

In other words, I want the search box to search both the Title string, but also a string within the Band. So searching “fine” would show “Closer to Fine” and “girl” would show every song by the “Indigo Girls.”
But I could also narrow the search by choosing a value from the other controls. And if nothing is in the search box, I’d still like to be able to filter by one or more other options.

This works only for the title:

thisRow.Title.Containstext(searchBox,true,true)

But when I try to make it search the title OR the band, it breaks:

thisRow.Containstext(searchBox,true,true)
OR
thisRow.Band.Contains(searchBox) 

And you can see my attempts to make the other options work also fails.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.