Hello,
My (fictional) app has multiple app entities like a BookEntity and an AuthorEntity. There is a relationship between them: a book has an author.
Because I implement the EntityPropertyQuery for the BookEntityQuery, it creates a “Find Book where...” intent. In this intent, I can filter the data by an author (AuthorEntity). But I can’t find a way to allow the user to select any author using the searchable modal usually presented to “choose” a parameter value from an intent for example.
Right now, it shows:
a menu with the suggestedEntities() authors if the AuthorEntityQuery implements this function. With no way to search even if the AuthorEntityQuery conforms to the EntityStringQuery.
a menu with allEntities() authors if the AuthorEntityQuery conforms to EnumerableEntityQuery and does not implement the suggestedEntities(). With no way to search even if the AuthorEntityQuery conforms to the EntityStringQuery.
nothing if suggestedEntities() is not implemented and allEntities() is also not implemented even if the AuthorEntityQuery conforms to the EntityStringQuery.
So this means
if I implement suggestedEntities(), my users have no way to choose any author not in the suggestions. It’s too limited.
if I implement allEntities() but not suggestedEntities(), this could potentially be a lot of entities and it’s not always relevant because then the Shortcuts app with an AuthorEntity parameter will be created for allEntities(), and the UI with always show the full list of allEntities() when I have to pick an author (unless I build a specific DynamicOptionsProvider but this would mean I lose the suggestedEntities() for example.
if I just conforms to EntityStringQuery, I can’t select any item at all for this filter (no menu to choose).
You can check the attached sample code provided.
I checked a bit other apps, for example the Photos app allows you to find a photo based on an album but it lists ALL the albums (which is a lot) with no way to search using string.
I also check the Sofa app, it shows the list of SofaListEntity (which implements suggestedEntities() and conforms to EntityStringQuery and EntityQuery). It actually shows all the lists (confirmed by the developer) with no way to search. See attachements from the Sofa developer.
Is there a way to support a search for a filter using a relationship conforming to the EntityStringQuery?
Is there a way to specify a provider for a @Property of an entity like we can for a @Parameter? For example, I could provide a custom DynamicOptionsProvider for the @Property(title: “Author”) var author which would be independent from the AuthorEntityQuery used elsewhere (parameter intents + Shortcuts).
Maybe you can suggest another way to implement this? Maybe I should not rely on a relationship but instead flatten the relationship in the BookEntity to add an “authorName” or “authorID”?
I filed this feedback with a sample code: FB23453134
Thanks,
Regards,
Axel
0
1
38