cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to dynamically create Data Item references?

WalterEdmondson
Level 2
I have a Multi Calc Stage.

Expression: [Code3]
Store In: [SqlCode]

Is it possible to instead do something like...

Expression: "[Code" + [Counter] + "]"
Store In: [SqlCode]

In the above example, the data item [Counter] is the number 3.

I would like to dynamically build the string [Code3] with a combination of string text and Data Items, and then reference that built string as a Data Item itself.

Is this possible?
3 REPLIES 3

HarpreetKaur
Level 7
Hello Walter,

That's easily doable. What you want to do is, introduce a data item for your expression stage.
Before the multi-calc stage, introduce another calc stage that builds this data item by appending the counter value to the previous value.. you can either append or replace value using string functions in the calc stage. Once you have your desired data item you can easily reference it in the multi-calc stage.

Regards
Harpreet

EVIPUTI
MVP
Yes its doable. Simply create another dataitem of type number acting as a counter and append the same with your dataitem in calc or multi calc stage .
------------------------------ Vipul Tiwari Senior Process Simplification Developer Amazon ------------------------------

Walter.Koller
Level 11
For what you want to achieve, there would be three options I can think of, but maybe I already started to think to complicated and there are easier possibilities.

One is to use references (pointers) to Data Items, stored in another Data Item. 
In your case [Expression] would not contain the name or the value of [CodeX] but the internal reference. 
But such Data Item type does not exist, so this won't work.

The other option is to have the content of a Data Item evaluated before BP evaluates the formular 
Although there is not such a feature of evaluating Data Items to use their content to create a fomular.

The only options would be to create a collection with several lines, each having the different code.
The next step would be to retrieve the needed line based on your dynamic value / counter. This could be done by using Filter Collection but maybe someone has a better idea.