Hi @sega2,
In that case you can probably first check if the parent folder is an item of type document set. You can check if the contenttypeid begins with 0x0120D520 (that is the id of the base Document Set content type).
If it is a document set you could retrieve its existing values and reuse it in update file properties action.
Below is an example of that approach.
This sample assumes that all document sets are created in the root of the library.
_api/web/lists/getbytitle('DocumentSetsExample')/Items?$filter=Title eq '@{split(triggerOutputs()?['body/{Path}'], '/')[1]}' and startswith(ContentTypeId, '0x0120D520')
