Skip to Content

Sender Rest Adapter- Convert XML to JSON - 1.00 value

Hi experts.

On the sender rest adapter i have the xml value 1.00 if i set the conversion to JSON:

1. Nothing: the adapter converts it in a string, i get: "1.00".

2. Custom XML/JSON conversion Rules, type decimal or float, i get: 1
3. Custom XML/JSON conversion Rules, type decimal or float, default value 0.00, i get: 1

Is there any possibility to get the value 1.00, as a number, with the point and the decimal values?

Regards.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Mar 08 at 05:42 AM

    Hello Iñaki,

    In ESR, data type definition, you set a field as Decimal, and if you click the "show data sheet" button, you will find the parameter fractionDigits which determines the number of displayed decimal places. For your case, you can set it 2, and you will get the value 1.00. For more details, check the following screenshots:

    Best Regards,

    Liz

    Add comment
    10|10000 characters needed characters exceeded

  • Mar 08 at 07:28 AM

    Hi Liz,

    I set the type as you said:

    And in the Rest adapter as well:

    But when the decimal value is .00, the decimal values are not showed:

    In monitoring before Rest proccesing i can see the two decimal values.

    What is your PI version and your PI SP?

    Regards.

    Add comment
    10|10000 characters needed characters exceeded

    • Hi Iñaki, did you find any solution for this? I'm having a similar problem but in receiver side. I'm sending from PI value 10.504, but after conversion in channel (using conversion XML/JSON custom rules), JSON value is 10.5

      Anyone has a similar issue?

      Best regards,

      Joan Llaully