Fetch a Label instead of the Value of an enumerated field

Avatar

Avatar

MeMonty

Avatar

MeMonty

MeMonty

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

View Entire Topic

Avatar

Avatar

wodnicki

MVP

Avatar

wodnicki

MVP

wodnicki
MVP

18-07-2019

Hi,

Here are a few solutions I've seen, in descending order of personal preference:

  • Interpolate current data into the message when retrieving it, which may be fine depending on your use cases and constraints
  • Extend nms:broadLog* table to capture personalization values at send, and interpolate, yielding accurate info at the cost of significant complexity and db space
  • If email, use archiving feature to capture materialized copies of each delivery
  • If email, use curl to archive mirror pages or otherwise extend their validity period and use directly in a csr tool
  • Use a post-processing workflow to dump personalization data into csv files to be archived
  • Replicate the db on every delivery sent (we're essentially doing this at a current client actually)

Thanks,

-Jon