Content Query "subdirectories" non-recursive

79 views
Skip to first unread message

Ricardo Fernández Serrata

unread,
Jul 17, 2021, 10:48:42 PM7/17/21
to Automate
I want to know how to get all valid paths for a specific URI. For example (not just a example, because it's my specific problem), if the URI is content://settings, I want to get an array similar to this ["system", "secure", "global"] preferably sorted by their IDs, such that I can get their IDs just by looking at the index. Or even better, a dictionary where the keys are the setting categories, and the values are their corresponding IDs, like this {"system": 0, "secure": 1, "global": 2}.

I want this to work with any other provider, not just settings please

Henrik "The Developer" Lindqvist

unread,
Jul 23, 2021, 10:03:10 AM7/23/21
to Automate
Only the content provider, i.e. the app handling the URI knows the URIs it supports, and there's usually no "directory" of them.

Ricardo Fernández Serrata

unread,
Jul 24, 2021, 2:29:46 AM7/24/21
to Automate
Thanks but, what input arguments should I use in the Content Query?
I've tried these:
Where: type='table'
Where: type='base_table'
Where: * ("any" wildcard char)
Where: type='*'
Limit: 1
Limit: null

And other values and combinations I read online. But I always get the same error:
java.lang.IllegalArgumentException: Supported SQL

Henrik "The Developer" Lindqvist

unread,
Jul 24, 2021, 11:43:55 AM7/24/21
to Automate
As said, there's not "directory" of tables.

Ricardo Fernández Serrata

unread,
Jul 25, 2021, 10:48:28 PM7/25/21
to Automate
So there's no way of "asking" (requesting) a content provider even for a small subset of valid URIs?
Well, at least we tried. Thanks anyways

Henrik "The Developer" Lindqvist

unread,
Jul 26, 2021, 6:48:01 AM7/26/21
to Automate
No, not as standard.

Ricardo Fernández Serrata

unread,
Sep 28, 2021, 12:48:27 PM9/28/21
to Automate
I found (again) this flow: llamalab.com/automate/community/flows/37254
Which answers 1 of my questions. I want to apologize to everyone in the community for asking a duplicate.

However, about the general-case question, the best way to get a list of valid URIs is (still) reading the documentation of the content provider in question. Or if the content provider has an URI that points to a table of metadata, then requesting data from that URI is enough to get a list of URIs.

Thanks to everyone for their time

Reply all
Reply to author
Forward
0 new messages