Enrich: dynamically selected field | Community
Skip to main content
maurizio_coro
Level 3
Nov 14, 2018 8:08 AM UTC
Solved

Enrich: dynamically selected field

Hello, I'm wondering if there's a way to have a dynamically set query:

I've 3 fields in the country table: offset1, offset2, offset3 and I'd like to assign one of this to a variabile inside a WF, something like that:

var.offset = recipient/country/@offset2

(meaning it will refers to the value inside the offset2 field)

Then, in a Enrichment activity, I need to add data from the corresponding field, so like if I wrote directly:

[recipient/country/@offset2] but using the variabile, because the reference depends on other custom behaviors.

Is there a way inside the Select additional columns window?

I've tried to concatenate string and variable, but it didn't work.

Any idea?

thanks

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
DebTrAccepted solution
Level 6
Nov 14, 2018 3:26 PM UTC

Hi maurizioc92956636​,

Once you have value in your variable using javascript, you can use the enrichment like following.

In Javascript

vars.sample="abc";

In Enrichment

Regards,

Deb

2 replies

maurizio_coro
Level 3
Nov 15, 2018 7:59 AM UTC

so, in my case, something like:

vars.fieldname = offset2;

and as enrich expression:

recipient/country/ + $(vars/@fieldname)

I'll give it a try, thanks a lot.

Maurizio

Translate
DebTrAccepted solution
Level 6
Nov 14, 2018 3:26 PM UTC

Hi maurizioc92956636​,

Once you have value in your variable using javascript, you can use the enrichment like following.

In Javascript

vars.sample="abc";

In Enrichment

Regards,

Deb

Translate