The words “main key” is throwing me off here.
If you are asking how you would setup the navigation from the main view to the filtered view, this is what I would do:
- I’ll assume you already have a table for the Resources. Make sure [Learning Areas] is a LIST type column.
- Create a table the defines each subject - named maybe “Subjects”. Include in this table at least: Main Subject, Image to use as the button, text to use as a caption (if desired).
- If you haven’t yet, create a view to act as the filtered view and set the data source to be the Resources table. This could be a Deck or Table view.
- If you haven’t already, create an Action with datasource set to Subjects table.
- In the action’s target, I would then adjust the expression to that below:
NOTE: I used “Main Subject” to avoid confusion with the name Subject from earlier.
[Learning Areas] replaces what I suggested as [Subject] above.
IF([Main Subject] = "ALL",
LINKTOFILTEREDVIEW(“My Filtered View” , true),
LINKTOFILTEREDVIEW(“My Filtered View” , IN([_THISROW].[Main Subject], [Learning Areas]))
- For the main view create a Gallery of the subject rows displaying the images and optional caption.
- Set the “Row Selected” Behavior in the Gallery view to your action that navigates to the filtered view.
I have not implemented this before so it’s not tested. I will build a quick sample app to test this out. The only uncertainty I have is if the IN() function will properly identify the data from the Subjects row and fill in the parameters to filter the Resources table.
The main gist:
Gallery view shows a list of images representing the different Subjects as “buttons” (they only mimic buttons). Tap a “button” which activates the Row Selected action. The action pulls the [Main Subject] from the Subjects row and uses that value in the IN() clause of the LINKTOFILTERDVIEW() function to filter the rows in the filtered view. The action then navigates to the filtered view listing only the rows indicated by the Subjects “button” selected.
I hope this all makes sense. I’ll build a quick test app to prove the concept (though i know others have done this). Be sure to ask questions!!