Forum Discussion

GBekkanti's avatar
GBekkanti
New Contributor III
7 years ago

Converting List of one item to Object

Hi Team,

Can you please let me know how to convert list of one object to one object.

Thanks in Advance!

4 Replies

  • Can you give an example of the input data and desired output data?

    I’m not sure I understand what you want to do.

    Thanks,
    Cole

    • GBekkanti's avatar
      GBekkanti
      New Contributor III

      Hi @cjhoward18,

      I am getting the data from source as below
      [{poNumber:12345, poItem:12, changedOn:2019-02-28}]
      I wan to convert the data to as below
      {poNumber:12345, poItem:12, changedOn:2019-02-28}

      I need to remove the object from list.

      Thanks and Regards,
      Gopi Bekkanti.

      • cjhoward18's avatar
        cjhoward18
        Employee

        if you know it is going to be a fixed sized array of one object you can use a mapper to access the element like this $arrayOfObject[0] then map it to a new variable like $object as the target and you will have pulled out the object from the array.

        Alternatively, you can make the list empty by using pop() like $arrayOfObject.pop() and map that to $object

  • Ganesh's avatar
    Ganesh
    New Contributor II

    You can try JSON Splitter in case of converting array values to individual objects.