I am in need of a reliable solution to manipulate pathItems in a one-to-many relationship similar to that of how a relational database works. I am open to any method as long as it adheres to the following requirements:
- The parent pathItem (“File 1”) must reside in a separate layer with unknown layer hierarchy
- Exclusion of all other pageItems that are not pathItems
- The relational aspect of the pathItems would ideally be hidden from the end-user
- Names (pathItem.name) need to remain unchanged although could be temporarily manipulated
- “Assets” layer is to remain locked and will always be a top-level layer
- “Assets” layer pathItems (“File 1 Asset 1” and “File 2 Asset 1”) will always be hidden

My current workflow generates unique ID numbers and assigns them to the parent pathItem and children automatically. My approach is to use hidden tags using the following method:
// method to add hidden tag
var pathItemTagID = selectedItem.tags.add();
pathItemTagID.name = "pathItemID";
pathItemTagID.value = pathItemNumber;
// method to create ID pathItemNumber
var pathItemNumber = generateRandomNumber(1, 1000);
function generateRandomNumber(min, max) {
var randomValue = Math.random();
var randomNumber = Math.floor(randomValue * (max - min + 1)) + min;
return randomNumber;
}
// methods for accessing the hidden tags:
alert("<<< ID Match >>>\n\n" + selectedItem.tags.getByName("pathItemID").name + "\n\n" + selectedItem.tags.getByName(“pathItemID”).value);
alert("<<< ID Match >>>\n\n" + selectedItem.tags[0].name + "\n\n" + selectedItem.tags[0].value);
To keep things simple all I need is the ability to delete pathItem (“File 1”) in the “Working Files” layer and consequently all of the related child pathItems (hidden or locked) in the “Assets” layer (“File 1 Asset 1”, “File 1 Asset 2” and “File 1 Asset 3”). I am in the hopes that this topic would be of value to others as well.