Compute SMS content length | Community
Skip to main content
February 22, 2019
Solved

Compute SMS content length

  • February 22, 2019
  • 11 replies
  • 5260 views

Hi,

I am looking to look for those SMS deliveries/delivery template through-out the AC instance where the content of the SMS exceeds 160 characters and I would want a list of all those campaigns exported.

I had a look at the delivery form and figured that while trying to preview any SMS delivery, it calculates the length and display the message if it exceeds more than 160 characters.

  <container colcount="2" colspan="2" type="visibleGroup" visibleIf="[/tmp/sms/preview/@length] &gt; 160">

                  <static/>

                  <static img="xtk:logwarn.png" label=" " nolabel="true">The content for this recipient exceeds the maximum SMS size of 160 characters.</static>

    </container>

How do I get access to [/tmp/sms/preview/@length] field via query activity so I can get the list of all SMS deliveries which has more than 160 chars??

Thanks.

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

Hey Anon,
I tried this and its working perfect

var qwe = xtk.queryDef.create(

      <queryDef schema="nms:delivery" operation="select">

          <select>

              <node expr="@id"/>

              <node expr="[content/sms/source]" alias="@content"/>

          </select>

          <where>

              <condition expr="@id=157651363"/>

          </where>

      </queryDef>

);

var result= qwe.ExecuteQuery();

for each(var res in result){

var tempValue=res.@content.toXMLString(true).length;

logInfo('str'+tempValue);

11 replies

asariaaaraAccepted solution
Level 3
March 7, 2019

Hey Anon,
I tried this and its working perfect

var qwe = xtk.queryDef.create(

      <queryDef schema="nms:delivery" operation="select">

          <select>

              <node expr="@id"/>

              <node expr="[content/sms/source]" alias="@content"/>

          </select>

          <where>

              <condition expr="@id=157651363"/>

          </where>

      </queryDef>

);

var result= qwe.ExecuteQuery();

for each(var res in result){

var tempValue=res.@content.toXMLString(true).length;

logInfo('str'+tempValue);