Replies

Highlighted

Avatar

Avatar

david_garcia1

MVP

Avatar

david_garcia1

MVP

david_garcia1
MVP

18-01-2018

Hey Jael,

Care to show the community your ad-hoc function code and paste some screenshots on what you can achieve with it.

Cheers.

Highlighted

Avatar

Avatar

jael91407431

Avatar

jael91407431

jael91407431

19-01-2018

Hi,

So I followed the documentation and formulated the following XML to be imported as a package into Campaign:

XML.png

Here is the raw code:

<?xml version="1.0" encoding='ISO-8859-1' ?>

<package

  namespace  = "nms"

  name        = "package-additional-funclist"

  label      = "Additional functions"

  buildVersion= "7.0"

  buildNumber = "8857">

  <entities schema="xtk:funcList">

    <funcList name="myList" namespace="jhl">

      <group name="ehl_functions" label="EHL Functions">

        <function name="vlookup" type="long" args="(&lt;vlookup&gt;)" help="Vertical (v)lookup searches down the first column of a range for a key and returns the value of a specified cell in the row found" minArgs="4" maxArgs="4" display="Vlookup will define based on parameters and arguments">

          <providerPart provider="SQL, MSSQL,Sybase,PostgreSQL" body="vlookup(lookup_value, Table_array, Col_index_num, Range_lookup)"/>

        </function>

      </group>

    </funcList>

  </entities>

</package>

...which follows, I think, the documentation:

acloop.png

Here is the template code Adobe provides in the documentation, those blocks of code to be replaced, I've highlighted in red:

<?xml version="1.0" encoding='ISO-8859-1' ?>

<package

  namespace = "nms"

  name = "package-additional-funclist"

  label = "Additional functions"

  buildVersion= "6.1"

  buildNumber = "10000">

  <entities schema="xtk:funcList">

  <funcList name="myList" namespace="cus">

  <group name="date" label="Personalized date">

  <function name="relativeMaturity" type="long" args="(&lt;Âge&gt;)" help="Returns the difference between a date and 18 years"

  minArgs="1" maxArgs="1" display="Relative maturity of the person born on the date $1">

  <providerPart provider="MSSQL,Sybase,PostgreSQL" body="extract(year from age($1))-18"/>

  </function>

  </group>

  </funcList>

  </entities>

</package>

So my raw code replaces replaces the Adobe's template sample with my own code (in red😞

<package

  namespace  = "nms"

  name        = "package-additional-funclist"

  label      = "Additional functions"

  buildVersion= "7.0"

  buildNumber = "8857">

  <entities schema="xtk:funcList">

    <funcList name="myList" namespace="jhl">

      <group name="ehl_functions" label="EHL Functions">

        <function name="vlookup" type="long" args="(&lt;vlookup&gt;)" help="Vertical (v)lookup searches down the first column of a range for a key and returns the value of a specified cell in the row found" minArgs="4" maxArgs="4" display="Vlookup will define based on parameters and arguments">

          <providerPart provider="SQL, MSSQL,Sybase,PostgreSQL" body="vlookup(lookup_value, Table_array, Col_index_num, Range_lookup)"/>

        </function>

      </group>

    </funcList>

  </entities>

</package>

Yet, when I try to load, (import as a package)  I am getting this error:

vloop2.png

Can anyone define what's wrong with either the code (presuming someone went there before--loading customized functions into Campaign) or anything else? Did I formulate the <body> tag correctly with the right syntax?

Vlookup syntax is the following: vlookup(lookup_value, Table_array, Col_index_num, Range_lookup)

Highlighted

Avatar

Avatar

jael91407431

Avatar

jael91407431

jael91407431

01-02-2018

So the syntax is relatively simple:

<package>
<entities schema="xtk:funcList">
<funcList name="myList" namespace="jhl">
<group name="ehl_functions" label="EHL Functions">
<function name="vlookup" type="long"
args="(&lt;vlookup&gt;)" help="Vertical (v)lookup
searches down the first column of a range for a key and returns the value of a
specified cell in the row found" minArgs="4"
maxArgs="4" display="Vlookup will define based on four (4)
arguments">
<providerPart provider="SQL, MSSQL,Sybase,PostgreSQL" body="vlookup($lookup_value,
$Table_array, $Col_index_num, $Range_lookup)"/>

Where $lookup_value, $Table_arry, $Col_index_num, $Range_lookup would be the actual xpath fields (i.e., columns or fields) that represents the values ($xpath field (attribute or column) for lookup_value, $xpath field (attribute or column) for Table_array, $xpath field (attribute or column) for Col_index_num, $xpath field (attribute or column) for Range_lookup).

Can someone validate this based on their own experience?

Highlighted

Avatar

Avatar

florentlb

Total Posts

1.1K

Likes

235

Correct Answer

239

Avatar

florentlb

Total Posts

1.1K

Likes

235

Correct Answer

239
florentlb

20-02-2018

Any update on this?

Florent