How to pick up current DELIVERY id in a DELIVERY report workflow | Community
Skip to main content
salvdangelo
Level 5
September 22, 2017

How to pick up current DELIVERY id in a DELIVERY report workflow

  • September 22, 2017
  • 2 replies
  • 6824 views

Hi everyone,

I am using a delivery report and in particular a query activity with a custom schema (containing delivery iDs in particular).
In "where condition" I would filter the records for the current delivery (SCHEMA.deliveryId = <currentDeliveryId>)

Someone could tell me how to do this?
Maybe it's a simple issue.


Thanks for helping!

Note: I am not using cube

Vipul RaghavAmit_Kumar

Jean-Serge Biron

Adhiyan

@nkur

Adobe Campaign

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Amit_Kumar
Level 10
September 24, 2017

Hi, Salvator,

In Adobe campaign this is controlled via context in reports, and this is the recommended way.

Read this here: Using the context

query activities in reports let you filter automatically using context like above.

let me know if you are getting stuck at any point.

Regards,

Amit

salvdangelo
Level 5
September 25, 2017

Hi Amit,

"Filter automatically with the context" is already flagged but I still see ALL THE RECORDS unfiltered for delivery id.
The same outcome if I flag in addition "limit the selected records" (limit to 1000 --> ALL THE RECORDS, limit to first record --> NO RECORD AT ALL).

Any suggestion?

Thanks,
Salvatore

Amit_Kumar
Level 10
September 25, 2017

Hi, Salvatore,

Are you using "Descriptive analysis" report or Adhoc Reports?

Can you enable the debug for this report of yours and check if you have _contextFilter? If you have this in your example post the inner XML from _contextFilter here?

It should be like this:

<_contextFilter>

    <where>

      <condition expr="@id = $noescaping(@_selection)" enabledIf="$(@_context) = 'selection' and $(@_hasFilter) = false" />

      <condition expr="@id" enabledIf="$(@_context) = 'selection' and $(@_hasFilter) and $(@_locationName) != 'descriptiveAnalysis'" subQuery="$(whereCond)" setOperator="IN" />

    </where>

  </_contextFilter>

Regards,

Amit

Jean-Serge_Biro
Level 10
September 29, 2017

Hi Salvatore,

You wrote in previous posts that:

  1. the Filter by context checkbox in the Query activity has been checked
  2. you run the report either being on a delivery and selecting your report through the dashboard, or in the preview mode by selection Selection checkbox and selecting the delivery

So you should have in the ctx (debug mode) the useful elements indicated by Amit.

Please confirm that way.

BR
JS

salvdangelo
Level 5
September 29, 2017

Hi Jean-Serge,

In debug mode, if selection type = "single selection" I have:

<where>

  <condition expr="@id = $noescaping(@_selection)" enabledIf="$(@_context) = 'selection' and $(@_hasFilter) = false" />

  <condition expr="@id" enabledIf="$(@_context) = 'selection' and $(@_hasFilter) and $(@_locationName) != 'descriptiveAnalysis'" subQuery="$(whereCond)" setOperator="IN" />

</where>

that is equal to that one that wrote Amit above.

Salvatore

Jean-Serge_Biro
Level 10
September 29, 2017

To sum up:

using debug mode, selecting the Selection check box, selecting one delivery in the folder (or listbox), you should have on the URL address bar something like this:

http://...&_context=selection%7CdeliverySending&_selection=1080026525&_selectionCount=1&lang=&_debug

where _selection argument value is the delivery id (primary key) of the delivery selected.

Now, for your Query activity, there are 2 cases:

1. either it is based on Delivery schema, and you have nothing to do, because Filter on context checkbox will automatically filter Delivery on the _selection argument value.

2. or it is based on your specific customer schema (I thought it was your use case...) and you have to inspired from the exemple of deliverySending report, Exclusion activity that I mentioned before for the foreign key used.

Then check in your context in debug mode the data retrieved and please share some screenshot for it. Or perhaps the issue is the relationship between your customer schema and the delivery schema, but I don't think so.

Please check also your parameter syntax, it seems you forgot the / for getting the _selection attribute from the root XML element :

SCHEMA.deliveryId equal to  [@_selection] (wrong)

instead of

SCHEMA.deliveryId equal to  [/@_selection] (right)

BR
JS