Let's Reconnect, thank you for making 2022 our best year yet.

Look Back
Accessing Configuration Keys in a Dynamic Way? — Cloud Customer Connect
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

Accessing Configuration Keys in a Dynamic Way?

Accepted answer
18
Views
6
Comments
edited Jun 7, 2022 1:11PM in General Technical Discussions 6 comments

Content

Hello everyone,

I've numerous config variables set in the Agent Desktop which go like

CUSTOM_CFG_SCRIPT_ABC_33
CUSTOM_CFG_SCRIPT_DEF_26
CUSTOM_CFG_SCRIPT_GHI_51
.
.
.
and so on...

To fetch the values of these keys, I know I can use something like this:

$variable = RNCPHP\Configuration::fetch(CUSTOM_CFG_SCRIPT_DEF_26);

But is there a way in which I can use a wildcard (*) in it? Something like this?

$variable = RNCPHP\Configuration::fetch(CUSTOM_CFG_SCRIPT_*_26); // btw this doesn't work
The above doesn't work and throws error. Anyway to come around this problem?

Version

CP3

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!