Skip to main content
Level 2
Mar 21, 2017 1:50 PM UTC
Solved

Fetch a Label instead of the Value of an enumerated field

Hi,

Suppose, I have a schema field based on an enumerated type

Enumerated datatype

  <enumeration basetype="byte" default="sms" label="Mobile message type" name="mobileMsgType">

    <value label="SMS" name="sms" value="0"/>

    <value label="WAP Push" name="wapPush" value="1"/>

    <value label="MMS" name="mms" value="2"/>

  </enumeration>

Column in the schema is defined of the type enumerated

      <attribute enum="mobileMsgType" label="Message type" name="mobileMsgType" type="byte"/>

When I use the querydef on such a column, it will return the value as "0" or "1" or "2". Instead, I want to fetch their labels like "SMS" or "WAP Push" or "MMS", could you please advise.

Regards,

Mahantesh

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
wizDart_com
wizDart_comAccepted solution
Level 2
Feb 26, 2018 2:01 PM UTC

Mahantesh,

You can easily accomplish this using  analyze=”true” parameter.

Basically in a querydef, you need to have the parameter: analyze=”true”.

For a field named @state, it will create attributes @stateLabel and @stateImg.

Then you can use that for your label values. Feel free to unicast me for a sample.

Arvind Jain [ cmu2010@gmail.com ]

6 replies

vraghav
Adobe Employee
Adobe Employee
Mar 23, 2017 10:03 PM UTC

Hi Mahantesh,

queryDef is used to fetch data from database. Enum however, is not present inside database, it is part of the schema definition and hence it will not be straightforward to export the enum label.

You will have to somehow read the schema definition, extract enum definition and compare it against your queryDef value to export enum label.

Hope this helps.

Regards,

Vipul

Translate
Linda_Stinson
Adobe Employee
Adobe Employee
Mar 24, 2017 3:48 PM UTC

Hi Mahantesh,

What do you want to do with the labels? You could make the substitution in your JavaScript.

Linda

Translate
MeMontyAuthor
Level 2
Mar 27, 2017 12:38 PM UTC

Hi Vipul,

Thanks for your response.

I am planning to export the data ... campaigns > deliveries > delivery logs & tracking logs  ... for all the campaigns into an external EDW database to analyse the effectiveness of each of the campaign/delivery.

If I use the Export (use Labels) through series of query/enrichment activities, I can get the labels. But since I need an email subject as well in the export, I am switching from enrichment to Javascript to create a staging table with limited columns (parallel to delivery) containing the delivery data with email subject. In the javascript I would like to have the labels instead of actual values to push into the staging table.

Regards,

Mahantesh

Translate
MeMontyAuthor
Level 2
Mar 27, 2017 2:28 PM UTC

Hi Linda,

Thanks for your response.

I have explained in a reply to Vipul ... what I want to do.

As per you, are you suggesting to hard coded the lables in Javascript?

Regards,

Mahantesh

Translate
wizDart_com
wizDart_comAccepted solution
Level 2
Feb 26, 2018 2:01 PM UTC

Mahantesh,

You can easily accomplish this using  analyze=”true” parameter.

Basically in a querydef, you need to have the parameter: analyze=”true”.

For a field named @state, it will create attributes @stateLabel and @stateImg.

Then you can use that for your label values. Feel free to unicast me for a sample.

Arvind Jain [ cmu2010@gmail.com ]

Translate
tejashriw155148
Level 4
Nov 21, 2019 11:21 AM UTC

could you please help to fetch enum label instead of values which has been created in schema?

Translate