not every account setting allows you to use expressions, many only accept hardcoded values. If they allow expressions you can use an expression library and then refer to it in your pipeline and use it in the account but this is a hit or miss and will not work in all cases.
If you intend to use different configurations/accounts in different environments you should create the accounts in each environments with the values that apply to this environment and then reference the name of the account in the snaps that need it. You can do something like this environment.expr file.
{
// Accounts, one in each environment.
"SFTP_ACCOUNT": {
"IT": "../../shared/SFTP Dev Account",
"TEST": "../../shared/SFTP Test Account",
"Prod": "../../shared/SFTP Prod Account"
},
// Functions
getOrgName : () => pipe.projectPath.split('/')[1],
getEnv : () => this.getOrgName().substr(9),
getEnvValue : (key) => this.get(key).get(this.getEnv())
}upload this as environment.expr to your shared folder and then reference it in the pipeline with the name env, Once you have that you can use lib.env.getEnvValue('SFTP_ACCOUNT') in the account of the Snap.
You will however need to manage the hostname in each account.