Diplaying text in custom format

I am storing phone number in plain text of 11 characters (ex. 01023456789) from a user input.

Then, I want to display this in (010)1234-5678 format. What I used is :truncated and :truncated from end operators when saving the value.

contact = input contact’s value: truncated from end 8:truncated 4-input contact’s value:truncated from end 4.

Initial storing is fine, but when the data is stored again by making changes, “-” in between is counted and ruins the result.

Is there any smarter way to achieve this?

Hi @yj.johnrhee,

A couple of options (there might be others):

  1. Before making changes, use find and replace to remove the formatting you applied before, f.i. remove () and -.
  2. Instead of saving the formatted value, just save the raw value and use truncated: only to display it in the format you prefer.
  3. Or, since we live in the age of big data, save it both ways, formatted and unformatted and according to the use case use one or the other.

Best Regards,

MVP Design

1 Like

Thanks for help @gerbertdelangen.

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.