Enrich: dynamically selected field

Avatar

Avatar
Give Back
Level 2
maurizio_coro
Level 2

Likes

15 likes

Total Posts

37 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 3
Ignite 1
Validate 10
Validate 1
View profile

Avatar
Give Back
Level 2
maurizio_coro
Level 2

Likes

15 likes

Total Posts

37 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 3
Ignite 1
Validate 10
Validate 1
View profile
maurizio_coro
Level 2

14-11-2018

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?

1620732_pastedImage_0.png

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

Any idea?

thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 25
Level 4
Deb007
Level 4

Likes

50 likes

Total Posts

86 posts

Correct reply

25 solutions
Top badges earned
Affirm 25
Boost 25
Applaud 5
Give Back 5
Validate 1
View profile

Avatar
Affirm 25
Level 4
Deb007
Level 4

Likes

50 likes

Total Posts

86 posts

Correct reply

25 solutions
Top badges earned
Affirm 25
Boost 25
Applaud 5
Give Back 5
Validate 1
View profile
Deb007
Level 4

14-11-2018

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

1621546_pastedImage_0.png

Regards,

Deb

Answers (1)

Answers (1)

Avatar

Avatar
Give Back
Level 2
maurizio_coro
Level 2

Likes

15 likes

Total Posts

37 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 3
Ignite 1
Validate 10
Validate 1
View profile

Avatar
Give Back
Level 2
maurizio_coro
Level 2

Likes

15 likes

Total Posts

37 posts

Correct reply

0 solutions
Top badges earned
Give Back
Ignite 3
Ignite 1
Validate 10
Validate 1
View profile
maurizio_coro
Level 2

14-11-2018

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