Hi @johnjohnPter,
I think in the same thread they also tried add new defaults without removing the old ones. But if you have already tried it lets go for your own suggested approach.
I would use the Full Path property and split it on the / character. In that case you could use the 2nd and 3rd item of the returned array.
Below is an example
1. Via a split expression the Client and DocType are retrieved
Client
split(triggerOutputs()?['body/{FullPath}'], '/')[1]
DocType
split(triggerOutputs()?['body/{FullPath}'], '/')[2]
2. Those are used in a couple of HTTP requests to retrieve the term id of the corresponding label
URI Client
_api/v2.1/termStore/groups/@{variables('TermGroupId')}/sets/@{variables('ClientTermSetId')}/terms?$filter=labels/any(a: a/name eq '@{split(triggerOutputs()?['body/{FullPath}'], '/')[1]}')
URI DocType
_api/v2.1/termStore/groups/@{variables('TermGroupId')}/sets/@{variables('DocTypeTermSetId')}/terms?$filter=labels/any(a: a/name eq '@{split(triggerOutputs()?['body/{FullPath}'], '/')[2]}')
I also got a blog about that approach:
https://www.expiscornovus.com/2022/12/29/get-terms-by-label/
3. With concat expressions they are used in an update file properties action (as a custom value)
Client
concat(split(triggerOutputs()?['body/{FullPath}'], '/')[1], '|', outputs('Send_an_HTTP_request_to_SharePoint_-_Client')?['body']['value'][0]['id'])
DocType
concat(split(triggerOutputs()?['body/{FullPath}'], '/')[2], '|', outputs('Send_an_HTTP_request_to_SharePoint_-_DocType')?['body']['value'][0]['id'])

Below is my test result.
