Skip to main content
Solved

Customer transformer converting string to integer

  • June 7, 2024
  • 2 replies
  • 115 views

jackyd
Supporter
Forum|alt.badge.img+16

I am using customer transformers in a work space, but they are converting a string value to integer

The values are 002 and 003, they need to stay this way for the http calls inside the custom transformer but are getting converted to 2 and 3 (without the 00)

As read from db
After entry into the custom transformer
​​​​

Any thought on how to prevent this?

I would like to have to avoid having do something in each custom transformer to revert the values back to the strings

 

Best answer by david_r

You can use a StringFormatter inside your custom transformer if you need leading zeros, e.g. using “03s” as the format string. If you think it’s a bug, I’d recommend you create a small sample workspace to reproduce the issue and submit it at support.safe.com.

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

2 replies

david_r
Celebrity
  • Best Answer
  • June 7, 2024

You can use a StringFormatter inside your custom transformer if you need leading zeros, e.g. using “03s” as the format string. If you think it’s a bug, I’d recommend you create a small sample workspace to reproduce the issue and submit it at support.safe.com.


jackyd
Supporter
Forum|alt.badge.img+16
  • Author
  • Supporter
  • June 11, 2024

Thanks @david_r, I found the StringPadder which does the job easily and I will pop in a bug report, as it looks like unintended behaviour