Variable call

Hello How can I call the variable on my JSON Body
for example {“AccountNumber”: +ListOfAccNumberAPI}

@shanti_18

Please try this

"{""AccountNumber"":""" + ListOfAccNumberAPI + """}"

in here listOfAccNumberAPI value will be "1234455678"

or is the ListOfAccNumberAPi is an actual list? and you want to pass as Json Array? if so

"{""AccountNumber"":[" + String.Join(",",ListOfAccNumberAPI) + "]}"

Or

"{""AccountNumber"":[""" + String.Join(""",""",ListOfAccNumberAPI) + """]}"

cheers

@shanti_18

"{'"+AccountNumber+"':'"+ListOfAccNumberAPI+"'}"

ListOfAccNumberAPi is a list, like hundreds of data.

not work for me, but thank you for the HELP

@shanti_18

So you want to json array of string?

if yes then pass as above

cheers

why do we need to double quote the key and value?

@shanti_18

In a json string the key is a string and is surrounded by double quotes…as per syntax…and in a string to escape a double quote we use double soublequotes

Cheerd

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.