Hello, I want to get the output in json string like {"param":["num1",["num2","num3"]]} in webmethods.io integration

Hello, I want to get the output in json string like {“param”:[“num1”,[“num2”,“num3”]]} in webmethods.io integration. you can use any input - string, stringList.

The screenshot of the jsonString in Document is as below.

image

Please assit me.

Thank you!!!

What documentation have you reviewed and what have you tried so far?

Review the docs and you’ll find the very simple answer very quickly.

1 Like

I tried multiple approches like
created 2 string list list1 and list2, used appendToStringList service.

list1 - [num1]
list2- [num2,num3]

list1 mapped - toList
list2 mapped - fromList

getting output in toList as

toList- [num1,num2,num3]

It might be a small thing. but i need small guidance to solve this.

Thank you.

if possible, could you please share the document links.

Have you done a Google or Bing search for SAG/webMethods documentation?

Search for the built-in services reference guide. Within that search for JSON.

Your description above for creating string list and such is the wrong path. You do not need to create the JSON string step-by-step yourself. The documentation will show how it can be done.

can you help me to get this output.

paramlist
paramlist [0] num1
paramlist[1]
patamlist[1][0] num2
paramlist[1][1] num3

What you are asking is a trivial however your approach to problem looks way off. Try explaining what you are trying to accomplish (your requirement) briefly first and check the link I provided. Instead of jumping over to conclusions and asking a solution for your attempted solution, you should tell us your requirements and what you have tried to attack that problem so far. Check the link and revise your question accordingly please.

my question is simple. you can use any of the below mentioned input. To get the output like mentioned above/below.

1.input: alist stringList - alist[0] = num1 or define a string alist = num1
blist stringList - blist[0] = num2
blist[1]= num3…size of blist varies like 5,10…so on.

  1. input : docList documentList - docList[0]
    string1 = num1
    docList[1]
    string2= num2
    string3 = num3…docList[1] may have more than 2 variables like 5,10…so on.

Output paramList stringList/objectList

paramlist
paramlist [0] num1
paramlist[1]
patamlist[1][0] num2
paramlist[1][1] num3

it may help you to get the requirement clear.