Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

The 4th edition of the Campaign Community Lens newsletter is out now!

QueryDef inside componment after a split

Avatar

Level 1

Hello,

My question is quit tricky.

I've a WF with a query, a split and after my own developped componment.

Inside I'm trying to make a queryDef on the temp table.

But as I have a branch in my split. My queryDef take one branch by hazard but not THE branch.

Do you have any idea?

How I take my schema :

var lastQuery = event.vars.targetSchema.toString();

And my queryDef :

<queryDef schema={lastQuery}>

Thanks for your help

5 Replies

Avatar

Level 4

Try using different segment codes for different branch in split block and use those values of segment codes to filter them inside the querydef.

Avatar

Level 1

Hello,

Thanks for you answer.

What do you mean by "Try using different segment codes for different branch"

As I'm inside a JS code that Adobe call automaticly by myName_call(){}

So I don't have the way to change a code for each branch.

Thanks

Michaël

Avatar

Level 4

Is it possible for you to post a screenshot of the workflow? I am assuming it is something like this... Please confirm.1645918_pastedImage_0.png

Avatar

Level 1

Hello,

As it's a componment it's more like that :

1645968_pastedImage_1.png

And Adobe, once is through by "delivery" call a JS. So all the context is done by the activities.

Thanks

Avatar

Level 5

Hi,

if I understand correctly, you want to dynamicaly get the temp schema of the previous activity/activities. If so, here is how I would implement it :

var schemaName = vars.targetSchema.substr(vars.targetSchema.indexOf(":")+1);

logInfo(schemaName);

var xml = <query schema={vars.targetSchema} operation="select">

                <select>

                  <node expr="@field1"/>

                  <node expr="@field2"/>

                </select>

              </query>;

var query = xtk.queryDef.create(xml).ExecuteQuery()[schemaName];

vars.results = query.toXMLString();

logInfo("vars.results : " + vars.results);

Kind regards,

Pierre

The ultimate experience is back.

Join us in Vegas to build skills, learn from the world's top brands, and be inspired.

Register Now