Forum Discussion
Hi @mmussitsch,
Problem I think was in this part
I don’t think that it can be mapped though multiple elements with only one set of square brackets.
Each square bracket is for only one element. I am not sure 100% about this but I think this was the problem.
I’ve changed the functions inside expression file a little bit.
Replaced projectPath with two other functions: getProjectSpace and getProject.
    "getOrgName": pipe.plexPath.split("/")[1],
    "getProjectSpace": x => x.split('/')[2],
    "getProject": x => x.split("/")[3],
    "whereAmI": this.getOrgName.toLowerCase().contains("prod") ? "Prod" : (this.getOrgName.toLowerCase().contains("test") ? "Test" : "Dev"),
    "getAccount": (path,type) => this.Accounts[this.getProjectSpace(path)][this.getProject(path)][type][this.whereAmI]
Here is the Accounts object.
    "Accounts": {
        "projectSpace": {
            "projectName": {
                "Salesforce": {
                    "Dev": {
                        "account_name": "Salesforce CIDEV"
                        }
                    }
                }
            }
        }
And here is the output.
Hope this will help you 🙂
Regards,
Viktor
Thanks so much Viktor for the help. You’ve helped me simplify some things and build upon them. I now have a pretty comprehensive file. In addition to the other functions, I have new ones like getProjectSpace, getProject, findProject, findProjectSpace, findAreabyProject, findAreabyProjectSpace so that if an item doesn’t have a “Project” definition it will default to the Project Space definition. They all work together in one call pullObject(“Salesforce”). It’s working very well.
One quick question, your code snippet, what editor/file format is that with all the colors. Sure is nicer to read than an unknown .expr file via Notepad++.
Thanks!
Melissa