I’ve searched for examples but not having much luck.
My data in the .expr file looks similar to this:
Accounts:
{
projectspace:
{
ProjectName:
{
Salesforce
{
Dev:
{
account_name : “Salesforce CIDEV”
},
}
…
I wrote a parsePath function call that would pull the project space and project. The function whereAmI uses getOrgName to determine the environment. Then ultimately, I’d like one call to get the Account based on the projectPath + type + env to get a single result.
getOrgName: pipe.plexPath.split(’/’)[1],
parsePath: x => (x.split("/")[x.split("/").length-2].replaceAll(" “,”") + “.” + x.split("/")[x.split("/").length-1].replaceAll(" “,”")),
whereAmI: this.getOrgName.toLowerCase().contains(‘prod’) ? “Prod” : (this.getOrgName.toLowerCase().contains(‘test’) ? “Test” : “Dev”),
getAccount: (path,type) => this.Accounts[this.parsePath(path)][type][this.whereAmI],
parsePath returns “projectspace.ProjectName” and whereAmI returns “Dev”. I’d like to pass in type as “Salesforce”. I know getAccount isn’t right. I just wanted to represent what I’m trying to do. I’ve made many variations to it without luck. I basically want to call lib.expr_lib.getAccount(pipe.projectPath,“Salesforce”) and return the value “Salesforce CIDEV”.
Appreciate any help!
Thanks.
Melissa