Hi.
If I understand correctly what you are trying to do **can** be done to a certain extent.
For your first level (not root), use the ID instead of the name for your autotext; and for the items, check the "Use prefix & IDs of upper levels" option, this way anything you add directly will use that ID.
Then for each sublevel/subset/folder just use the "Assign ID automatically" option for the subset identification, this will read the ID of the top level (NAME1 in your case). This can go as deep as needed, and will read the ID of the top level.
Copy everything and change to NAME2 and every ID updates for those contained in that subset.
In the autotext, use subset ID instead of subset name. It works, but you may run into other issues, such as numbering.
In attached, the same master is used in all layouts, viewing a layout from sublevel 3 and showing the first ID of the top subset (NAME1)
Hope I understood correctly and this helps.
Best regards.