Forum Discussion

MFzOS's avatar
MFzOS
Occasional Contributor
2 years ago
Solved

Using Property Transfer in Ready API, How Can I Transfer a Numeric Value into JSON object?

Hi, When fetching data source from EXCEL file, I need to transfer some of the values to JSON objects. All values are being parsed in as string format. How can I parse in values as integer instead wh...
  • richie's avatar
    richie
    2 years ago

    Hey MFzOS 

     

    Ok - so I've set it up and it runs fine - when I first did it, it auto generated quote marks around the numeric values that ive parameterized in my payload, but once I'd removed them it works fine

     

     

    have a look at the following screenshots:

     

     

    In the above screenshot you can see Im sourcing data from a csv using the Datasource (file) type.

    The first two values auto generate alpha numeric values, but column 3 includes a numeric and column 4 includes a string 1.0 is wrapped in quotes

     

    Next - if you look at the REST request in the screenshot below - in the Request tab and the payload editable field - you can see Im sourcing data from the Data Source test step.  

    if you look at the 'defraexp_ehcstatus' attribute value in the input payload above - the parameterized value is NOT wrapped in quotes (so it's numeric)

    If you look at the 'defraexp_ehcversion' attribute value in the input payload above - the parameterized value IS wrapped in quotes (so it's a string)

     

    Now - if you look at the next screenshot, you can see the RAW of the request - which shows what is submitted - in this case, the submitted payload maintained the attributes' datatypes relative to what was defined

     

     

    cool?

     

    Cheers,

     

    Rich