none
integration account , JSON -JSON transformation - Liquid error: Value was either too large or too small for an Int32. RRS feed

  • Question

  • Getting the error "Liquid error: Value was either too large or too small for an Int32.". Please help.

    While using the integration account in Logic apps for performing JSON to JSON transformation i received the below response.

    {
    "statusCode": 200,
    "headers": {
    "Pragma": "no-cache",
    "Transfer-Encoding": "chunked",
    "Vary": "Accept-Encoding",
    "Cache-Control": "no-cache",
    "Date": "Fri, 27 Sep 2019 13:54:49 GMT",
    "Server": "Microsoft-IIS/10.0",
    "X-Powered-By": "ASP.NET",
    "Content-Type": "application/json; charset=utf-8",
    "Expires": "-1",
    "Content-Length": "474"
    },
    "body": [
    {
    "Amount": "10000",
    "UserId": "Liquid error: Value was either too large or too small for an Int32.",
    "EmailId": "xyz@gep.com",
    "UserManagerId": "Liquid error: Value was either too large or too small for an Int32.",
    "UserName": "Jeffrey Buell"
    },
    {
    "Amount": "50000",
    "UserId": "Liquid error: Value was either too large or too small for an Int32.",
    "EmailId": "xyz@gep.com",
    "UserManagerId": "Liquid error: Value was either too large or too small for an Int32.",
    "UserName": "Aric Goldschmidt"
    }
    ]
    }

    My liquid template file is - 

    [{% for person in content %}
    {
        "Amount": "{{person.AuthorizeAmount}}",
        "UserId": "{{''person.ContactCode}}",
        "EmailId": "{{person.EmailAddress}}",
        "UserManagerId": "{{person.ManagerId}}",
        "UserName": "{{person.UserName}}"
    },
    {% endfor %}]


    Friday, September 27, 2019 2:04 PM

All replies

  • Hello Nisheeth,

    Looking at the error it seems that the value of ContactCode is not correctly parsed. Can you verify the value for contact code. Also I can see there is '' in the userID section of the template.

     "UserId": "{{''person.ContactCode}}" it should be "UserId": "{{person.ContactCode}}"

    Saturday, September 28, 2019 2:57 PM
    Moderator
  • Hi Ketan,

    Please find the details below for input and the Liquid template used. Since Contact Code is beyond the limit of INT 32 i am getting this error. Is there any round around for this situation ??

    Input provided is -

    [
    {
    "AuthorizeAmount": 10000,
    "ContactCode": 44351504000005,
    "Designation": "DIRECTOR",
    "DpaType": null,
    "EmailAddress": "xyz@gep.com",
    "ManagerId": 44351504000039,
    "ProxyContactCode": 0,
    "ProxyDesignation": "",
    "ProxyUserName": "",
    "UserName": "Jeffrey Buell"
    },
    {
    "AuthorizeAmount": 50000,
    "ContactCode": 44351504000007,
    "Designation": "SR_DIRECTOR",
    "DpaType": null,
    "EmailAddress": "xyz@gep.com",
    "ManagerId": 44351504000039,
    "ProxyContactCode": 0,
    "ProxyDesignation": "",
    "ProxyUserName": "",
    "UserName": "Aric Goldschmidt"
    }
    ]

    Liquid Template Used - 

    [{% for person in content %}
    {
        "Amount": "{{person.AuthorizeAmount}}",
        "UserId": "{{person.ContactCode}}",
        "EmailId": "{{person.EmailAddress}}",
        "UserManagerId": "{{person.ManagerId}}",
        "UserName": "{{person.UserName}}"
    },
    {% endfor %}]

    Sunday, September 29, 2019 11:53 PM
  • Hello Nisheeth,

    Thank you for providing the details. I can also repro the same. I am checking this internally with PG and will update this thread. 

    Stay tuned!!

    Update:

    I am working with PG on this in the mean time to workaround this if you can explicitly convert all the Long Numbers in to a string that would resolve your issue.

    Monday, September 30, 2019 5:36 AM
    Moderator
  • Hi Ketan,

    Can we convert long integers to string in the liquid template through any way ?

    Thanks

    Nisheeth


    Friday, October 4, 2019 5:02 PM
  • Hi Ketan,

    I tried to convert the long Number to String with Liquid template using | downcase. Still getting the same error Liquid error: Value was either too large or too small for an Int32.

    Thanks

    Nisheeth

    Thursday, October 10, 2019 8:05 AM