Tc Create And Update Multi: Simple create of five objects

This example shows the input document that creates five objects in one call, one of which also carries item revision attributes.

In the snap configuration following values has to fed into fields:

  • $objects to Objects Path
  • “object_string” and “object_desc” in Expand Attributes
[
    {
        "objects": [
            {
                "object_type": "Item",
                "object_name": "DocumentationTest0",
                "object_desc": "Test0"
            },
            {
                "object_type": "Item",
                "object_desc": "Test1",
                "object_name": "DocumentationTest1",
                "revision": {
                    "object_desc": "Test1 revision"
                }
            },
            {
                "object_type": "Item",
                "object_name": "DocumentationTest2",
                "object_desc": "Test2"
            },
            {
                "object_type": "Item",
                "object_name": "DocumentationTest3",
                "object_desc": "goo"
            },
            {
                "object_type": "Item",
                "object_desc": "Test5",
                "object_name": "DocumentationTest5"
            }
        ]
    }
]

Snap configuration

Snap output


Settings tab of Create And Update Multi Snap. Field Objects Path has expression to read 'objects' from input document. Table Expand Attributes has two rows for 'object_string' and 'object_desc'.

[
  {
    "result": [
      {
        "entities": [
          {
            "_id": "TC*Item*null***AGJAApgK7hAnmD",
            "object_desc": "Test0",
            "object_string": "052967-DocumentationTest0",
            "UID": "AGJAApgK7hAnmD"
          },
          {
            "_id": "TC*ItemRevision*null***AaNAApgK7hAnmD",
            "object_desc": "Test0",
            "object_string": "052967/A;1-DocumentationTest0",
            "UID": "AaNAApgK7hAnmD"
          }
        ],
        "original": {
          "object_desc": "Test0",
          "object_name": "DocumentationTest0",
          "object_type": "Item"
        }
      },
      {
        "entities": [
          {
            "_id": "TC*Item*null***AGLAApgK7hAnmD",
            "object_desc": "Test1",
            "object_string": "052968-DocumentationTest1",
            "UID": "AGLAApgK7hAnmD"
          },
          {
            "_id": "TC*ItemRevision*null***AaPAApgK7hAnmD",
            "object_desc": "Test1 revision",
            "object_string": "052968/A;1-DocumentationTest1",
            "UID": "AaPAApgK7hAnmD"
          }
        ],
        "original": {
          "object_desc": "Test1",
          "object_name": "DocumentationTest1",
          "object_type": "Item",
          "revision": {
            "object_desc": "Test1 revision"
          }
        }
      },
      {
        "entities": [
          {
            "_id": "TC*Item*null***AGNAApgK7hAnmD",
            "object_desc": "Test2",
            "object_string": "052969-DocumentationTest2",
            "UID": "AGNAApgK7hAnmD"
          },
          {
            "_id": "TC*ItemRevision*null***AeBAApgK7hAnmD",
            "object_desc": "Test2",
            "object_string": "052969/A;1-DocumentationTest2",
            "UID": "AeBAApgK7hAnmD"
          }
        ],
        "original": {
          "object_desc": "Test2",
          "object_name": "DocumentationTest2",
          "object_type": "Item"
        }
      },
      {
        "entities": [
          {
            "_id": "TC*Item*null***AGPAApgK7hAnmD",
            "object_desc": "goo",
            "object_string": "052970-DocumentationTest3",
            "UID": "AGPAApgK7hAnmD"
          },
          {
            "_id": "TC*ItemRevision*null***AeDAApgK7hAnmD",
            "object_desc": "goo",
            "object_string": "052970/A;1-DocumentationTest3",
            "UID": "AeDAApgK7hAnmD"
          }
        ],
        "original": {
          "object_desc": "goo",
          "object_name": "DocumentationTest3",
          "object_type": "Item"
        }
      },
      {
        "entities": [
          {
            "_id": "TC*Item*null***AKBAApgK7hAnmD",
            "object_desc": "Test5",
            "object_string": "052971-DocumentationTest5",
            "UID": "AKBAApgK7hAnmD"
          },
          {
            "_id": "TC*ItemRevision*null***AeFAApgK7hAnmD",
            "object_desc": "Test5",
            "object_string": "052971/A;1-DocumentationTest5",
            "UID": "AeFAApgK7hAnmD"
          }
        ],
        "original": {
          "object_desc": "Test5",
          "object_name": "DocumentationTest5",
          "object_type": "Item"
        }
      }
    ],
    "original": {
      ...
    }
  }
]