webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
Expand all | Collapse all

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

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

    Posted Fri November 17, 2023 09:29 AM

    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!!!


    #webMethods
    #webMethods-io-Integration


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

    Posted Fri November 17, 2023 09:44 AM

    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.


    #webMethods
    #webMethods-io-Integration


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

    Posted Fri November 17, 2023 10:36 AM

    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.


    #webMethods
    #webMethods-io-Integration


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

    Posted Fri November 17, 2023 10:49 AM

    if possible, could you please share the document links.


    #webMethods
    #webMethods-io-Integration


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

    Posted Fri November 17, 2023 11:54 AM

    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.


    #webMethods-io-Integration
    #webMethods


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

    Posted Fri November 17, 2023 01:35 PM

    can you help me to get this output.

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


    #webMethods
    #webMethods-io-Integration


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

    Posted Fri November 17, 2023 03:39 PM

    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.


    #webMethods
    #webMethods-io-Integration


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

    Posted Sat November 18, 2023 03:38 AM

    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.


    #webMethods
    #webMethods-io-Integration