I thought I had done that. Obviously writing the use case in English rather than techie speak is the wrong way to go. So;
I am reporting on articles from music journals. The tables in play are:
-
Journal: JournalID (Primary Key); Journalname; other fields
-
Article: ArticleId (Primary Key); JournalId (Reference to Journal); Author (Reference to Author); Title, Page #, Precis, etc.
-
ArticleWork: ArticleWorkId (Primary Key); ArticleId (Reference to Article); WorkId (Reference to Work)
-
Work: WorkId (Primary Key); Title, description, etc
-
Author: AuthorId (Primary Key); AuthorName; other fields
The requirement in both use cases is to populate a repeater block with details of an article. We want fields including Journal name, Page, Article title, Author, and other article-level fields like a precis.
In the first use case, the user will select an Author from a table of authors. The repeater will be populated with articles the author wrote. Two datasets: Author and Article, with article filtered on the selected Author. Works fine.
In the second case, the user will select a work from a table of works. The repeater will be populated with articles about the work (i.e. articles with a record in the ArticleWork table for the work). I have tried with just two datasets: Work and ArticleWork, with ArticleWork filtered on the selected WorkId. When trying to assign sources of fields for the JournalName and the Author, the fields are shown in the dialogue box, but are greyed out, with no explanation. I expect it is because there are too many levels of indirection. I have also tried to add a third dataset which did not work: I got all repeater blocks reporting fields from the first match.
I suspect this is one of those “we didn’t write that bit” issues. Wix will happily ‘lookup’ a journal name when there is an active dataset for Article, but not where the reference to Article is indirect through ArticleWork. (in this case, I can see that is not an awful restriction to have added - someone might extrapolate my example to many mor levels of indirection - but they should not add such restrictions (if that is indeed what has happened) without documenting the restriction). I have tried to add another dataset for Article in use case 2. That did not seem to fix the problem.
There are work-arounds, but they are a bit messy. I could replicate Journal-level data such as the JournalName into the Article table, so the extra lookup is not required. I could change the primary key of the Journal table to be the JournalName (which should all be unique), but we will hit issues with sort sequences (e.g. #101 sorting before #20, unless we number them #020, which users will think is naff).
So, not a show-stopper, but I would like to know (and I would like Wix to document this sort of thing - their documentation is awful on issues like this).
