Ok, understood now.
Just originally thought to have list organized a bit differently (sort of index list. like INDEX tables):
Items are values of parameter X.
Inside each item keys are value of parameter Y and their values are corresponding Services.
If there is necessity to work in paradigm list item presents service with attributes, probably ListGetDataCfg not very straightforward. Something like that still might work I think:
- create combined key like x_y and its values will be accordingly combined values of these parameters, like your sample will turns into:
List Object: TARGETS
Item Service A
Key x_y value 1_1
Item Service B
Key x_y value 1_2
Item Service C
Key x_y value 2_3
etc
In such case to find service the following probably might work:
list= ListGetDataCfg[TARGETS, '*', 'x_y']
in list you get something like ServiceA:1_1|ServiceB:1_2|ServiceC:2_3 and after that it has to be scanned for proper pair value (like one having 1_2 as value) and its key to be obtained.
Better solution might be using FindConfigObject function.
1. list= FindConfigObject[CFGTransaction, 'type=21|name=TARGETS'] - in list will be placed entire transaction object
2. annex= KVListGetListValue[list, 'annex'] - in annex will be entire user properties of the TARGETS object something like list of sublsists:
Service A
x=1
y=1
Service B
x=1
y=2
Service C
x=2
y=3.
3. what left is performing something like "select item_service from TARGETS where x = %1 and y = %2" on this list object:
sublist= KVListFindPairs[annex, 'x:1|y:2'] - going to returns sublist of annex having only those "Services" that has x=1 and y=2 in its properties. Something like:
Service B
x=1
y=2
Any elements of received "Service" can be accesed as well as key (service name) itself (KVListGetKey[sublist, 1])