Combine/rearrange properties and collections

As you create your API, kimono will automatically structure your data model based on the elements you select on the page. This means that kimono will group like elements together in collections - e.g., if you are looking at an IMDB movie page, the movie information (title, release date) will be in a different collection from the cast and crew information (actor, role).

If you'd like to adjust the data model to create new collections or merge collections and datatypes, navigate to the data model view by selecting  and then selecting the Editor link 

 

You can now drag and drop the properties into their own collections, into a new collection, or you can merge data properties together. 

When you move two properties into the same collection, the individual elements will be forced to associate. For example, if we moved 

points from collection2 to collection1 as in the image above, we would get:

Before:

{
  "collection1": [
    {
      "name": "Ryan",
    },
    {
      "name": "Sarah",
    },
    {
      "name": "Summer",
    }
    {
      "name": "Britney",
    },
    {
      "name": "John",
    }
  ],
  "collection2": [
    {
      "points": "212 points",
    },
    {
      "points": "119 points",
    },
    {
      "points": "39 points",
    }
  ]
}

After:

{
  "collection1": [
    {
      "name": "Ryan",
      "points": "212 points",
    },
    {
      "name": "Sarah",
      "points": "119 points",
    },
    {
      "name": "Summer",
      "points": "39 points",
    }
    {
      "name": "Britney",
      "points": "",
    },
    {
      "name": "John",
      "points": "",
    }

  ]
}

Notice that the association was made linearly, from the top. Because there were only 3 items in the points dataset, the last two items in the names dataset have no points associated with them and are given blank values. When you move a property into the dropzone with the title "New collection", a new collection is spawned containing only that property, therefore no data association happens.

When you merge two properties into the same property, the new data property will contain the information from both of the previous properties

 

Before:

{
"collection1": [
  {
    "property1": "Ryan",
  },
  {
    "property1": "Sarah",
  },
  {
    "property1": "Summer",
  }
  {
    "property1": "Britney",
  },
  {
    "property1": "John",
  }
],
"collection2": [
  {
    "property2": "Sam",
  },
  {
    "property2": "Henry",
  },
  {
    "property2": "Alex",
  }
]
}

After:

{
"collection1": [
  {
    "property1": "Ryan",
  },
  {
    "property1": "Sarah",
  },
  {
    "property1": "Summer",
  }
  {
    "property1": "Britney",
  },
  {
    "property1": "John",
  }
  {
    "property1": "Sam",
  },
  {
    "property1": "Henry",
  },
  {
    "property1": "Alex",
],
}
Powered by Zendesk