merging dictionaries

I make a call to an integration and receive an output like above. I have a requirement where i need to append every dictionary that comes under cells with the corresponding row ID in the top and save it in table. how do i do that ?

  Discussion posts and replies are publicly visible

Parents
  • a!localVariables(
       local!myDictionary: {
         id: 123456,
         fieldOne: Hello,
         fieldTwo: World,
         cells: {
            {
              columnId: 1,
              value: foo
            },
            {
              columnId: 2,
              value: bar,
            }
         }
       },
       local!newDictionary: {
          id: local!myDictionary.id,
          fieldOne: local!myDictionary.fieldOne,
          fieldTwo: local!myDictionary.fieldTwo,
          cells: a!forEach(
             local!myDictionary.cells,
             {
                columnId: fv!item.columnId,
                value: fv!item.columnId,
                parentId: local!myDictionary.id
             }
          )
       },
       local!newDictionary
    )

    Here is a code example that should get you started. I also recommend using a!map() instead of a dictionary because it will preserve the type information

    docs.appian.com/.../fnc_system_map.html

Reply
  • a!localVariables(
       local!myDictionary: {
         id: 123456,
         fieldOne: Hello,
         fieldTwo: World,
         cells: {
            {
              columnId: 1,
              value: foo
            },
            {
              columnId: 2,
              value: bar,
            }
         }
       },
       local!newDictionary: {
          id: local!myDictionary.id,
          fieldOne: local!myDictionary.fieldOne,
          fieldTwo: local!myDictionary.fieldTwo,
          cells: a!forEach(
             local!myDictionary.cells,
             {
                columnId: fv!item.columnId,
                value: fv!item.columnId,
                parentId: local!myDictionary.id
             }
          )
       },
       local!newDictionary
    )

    Here is a code example that should get you started. I also recommend using a!map() instead of a dictionary because it will preserve the type information

    docs.appian.com/.../fnc_system_map.html

Children