Solved

How to convert BYTE_ARRAY to String?

  • 29 March 2023
  • 5 replies
  • 78 views

How to convert BYTE_ARRAY to String?

I wanted to convert BYTE_ARRAY to String.

version i am using 3.1.6

I have tried using field type converter, but it is changing the value

field type converter -

Preview mode- please see my_value is changed

 

How I can convert BYTE_ARRAY to STRING? please suggest.

icon

Best answer by Bikram 30 March 2023, 18:49

View original

5 replies

@saleempothiwala Can you please help in this?

Userlevel 5
Badge +1

@pankaj.vishwasrao 

 

I am using data collector version 5.1 and field converter is giving me the correct result but for your case i also tried to convert byte_array in jython evaluator and its giving the result as expected.Please find attached the pipeline which is converting byte_array to string using jython evaluator as well as field converter.

 

Please let me know if it helps to fix your issue or not.

Thanks & Regards

Bikram_

Thank you @Bikram for your reply.

My requirement is  to store BYTE_ARRAY as a String in Database.

For Example - BYTE_ARRAY is 54fa41242befd4329317cb2e90ea0f76 and I wants to store this value as string /raw value “54fa41242befd4329317cb2e90ea0f76” in database.

I don’t want string value of byte array (as you have showed above) 

Userlevel 5
Badge +1

@pankaj.vishwasrao 

Please try below ode in your expression evaluator which will convert byte_array to string type.

Below the result for your reference. I hope this helps. I also attached the pipeline for your reference.

 

Thanks & Regards

Bikram_

Thank you very much @Bikram it’s working as expected.

Reply