Shweta Soparkar Shweta Soparkar - 1 year ago 101
reST (reStructuredText) Question

How to pass a value JSON String

This is a line in my JSON file

"sfdc_id": "**********"

parsed to====> \"sfdc_id\": \"************\"

I want this to except the value dynamically.

"sfdc_id": "c[0].Id"

I now want to pass the value of id dynamically.

How can I do it?

Answer Source
String example='\"reg_citizenship\": null,'+
    '            \"synch\": null,'+
    '            \"reg_portalaccess\": false,'+
    '            \"sfdc_id\": \" ' 
                  +  c.Id  + 
    '               \"  '+
    '        }';

This is how I added the value dynamically to JSON String

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download