Fetch a Label instead of the Value of an enumerated field

Avatar

Avatar
Validate 1
Level 1
MeMonty
Level 1

Likes

4 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
MeMonty
Level 1

Likes

4 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
MeMonty
Level 1

21-03-2017

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Validate 1
Level 1
wizDart_com
Level 1

Like

1 like

Total Posts

4 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile

Avatar
Validate 1
Level 1
wizDart_com
Level 1

Like

1 like

Total Posts

4 posts

Correct reply

1 solution
Top badges earned
Validate 1
Boost 1
Affirm 1
View profile
wizDart_com
Level 1

26-02-2018

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 ]

Answers (5)

Answers (5)

Avatar

Avatar
Validate 1
Level 2
tejashriw155148
Level 2

Likes

12 likes

Total Posts

70 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile

Avatar
Validate 1
Level 2
tejashriw155148
Level 2

Likes

12 likes

Total Posts

70 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Give Back 5
Give Back 3
Give Back
Boost 5
View profile
tejashriw155148
Level 2

21-11-2019

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

Avatar

Avatar
Validate 1
Level 1
MeMonty
Level 1

Likes

4 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
MeMonty
Level 1

Likes

4 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
MeMonty
Level 1

27-03-2017

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

Avatar

Avatar
Validate 1
Level 1
MeMonty
Level 1

Likes

4 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 1
MeMonty
Level 1

Likes

4 likes

Total Posts

9 posts

Correct reply

0 solutions
Top badges earned
Validate 1
Boost 3
Boost 1
Applaud 5
View profile
MeMonty
Level 1

27-03-2017

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

Avatar

Avatar
Validate 1
Employee
Linda_Stinson
Employee

Likes

51 likes

Total Posts

250 posts

Correct reply

77 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 20
Ignite 10
View profile

Avatar
Validate 1
Employee
Linda_Stinson
Employee

Likes

51 likes

Total Posts

250 posts

Correct reply

77 solutions
Top badges earned
Validate 1
Ignite 5
Ignite 3
Ignite 20
Ignite 10
View profile
Linda_Stinson
Employee

24-03-2017

Hi Mahantesh,

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

Linda

Avatar

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

370 likes

Total Posts

726 posts

Correct reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile

Avatar
Validate 1
Employee
Vapsy
Employee

Likes

370 likes

Total Posts

726 posts

Correct reply

342 solutions
Top badges earned
Validate 1
Boost 50
Boost 5
Boost 3
Boost 250
View profile
Vapsy
Employee

23-03-2017

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