I have a list with a termstore column. The particular termstore is clearly organized by hierarchy. Given a particular term (either label or guid) I need to filter the items in the list to find items that are descendants (or children - a single level would suffice) of that term.
So, given this hierarchy (sorry for the poor presentation - this editor apparently doesn't do well with multi-level lists):
Given the term A I want to be able to filter the list to just items where the termstore column contains either (direct children: A1, A2) or (all descendants: A1, A1-1, A1-2, A2, A2-1, A2-2). Given the term A1 I want to be able to filter the list to just items where the termstore column contains (direct children: A1-1, A1-2) or (all descendants: same). Given the term TOP I want to be able to filter the list to just items where the termstore column contains (direct children: A, B) or (all descendants: all items).
Note that EITHER the "direct children" OR the "all descendants" result would be equally satisfactory for my requirements.
The actual termstore hierarchy is fairly long (several hundred items if the top level were chosen) and so solutions containing "or" in the odata filter are going to run up against length limitations.
Performance matters in this case because the flow is triggered by http call from a ui page in js and the user is waiting on this response to populate a select list. Waiting 10-15 seconds (or even 30-40) is somewhat acceptable, but waiting 5-10 minutes won't cut it.
Attempted solutions rejected (so far):
It seems like this would be a simple application of the operator "StartsWith" on the guidPath property of the termstore column, but I can't figure out the odata syntax to make use of the guidPath property.
Have a look at this thread: Managed Metadata column is supported in OData Filt... - Power Platform Community (microsoft.com) Although I'm not sure using CAML query gets all "descendant" items also. Apart from that, it won't work with multi-value MMS.
Anyway, hope it helps!
@fchopo thank you for your engagement. I believe you have given me the correct answer "it won't work".
I won't mark this as a solution, despite its correctness, because I don't want to give others the impression that my problem was solved.
Learn how to create your own user groups today!
Check out the new Power Platform Community Connections gallery!
Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.