Highlighted

QueryDef inside componment after a split

mic48519263

10-12-2018

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

Replies

Highlighted

saikatk2447661

13-12-2018

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

Highlighted

mic48519263

13-12-2018

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

Highlighted

saikatk2447661

13-12-2018

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

Highlighted

mic48519263

13-12-2018

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

Highlighted

pierrec70731455

06-05-2019

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