Help with customizing print template

kaekae Member Posts: 2

Hi there,

We have a requirement to only display a subset of the string we are capturing for the serial number. If we have something like 010931070491620221RMEA43WWNDE6\u001d240DG00099.00, how do we go about displaying 10 characters from position 12?

I tried Serial#: {{ Serialized.serial | slice(12, 10) }} {{ Serialized.color }} {{ Serialized.size }} but I was getting Array in the result.

Any suggestion will be much appreciated.

Thanks.

Best Answer

Answers

  • kaekae Member Posts: 2

    Thanks @gregarican ,

    I found the reason why it wasn't working for me. "\u001d" is being rendered as "". I modified my script as follows:

     {{ Serialized.serial |replace({'': ""}) | slice(12,10)}} {{ Serialized.color }} {{ Serialized.size }}

    It worked.

    Thanks again!

Sign In or Register to comment.