amit_saroha
4 years agoNew Contributor III
Expression File Functions and Read Expression
Hi,
Below is a sample expression file is shown in another thread and I want to understand what exactly the functions are doing and their purpose. I also want to understand how the expression works to read the file values.
File contents -
“Accounts”: {
“projectSpace”: {
“projectName”: {
“Salesforce”: {
“Dev”: {
“account_name”: “Salesforce CIDEV”
},
“PRD”: {
“account_name”: “Salesforce CIDPRD”
}
}
}
}
}
"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]
Expression - (How it works)
lib.expr_lib.getAccount(pipe.projectPath,“Salesforce”)