Feature Request: Data Ingestion for Integration Fields

Hi team, I'm trying out integration fields and finding it's a powerful feature. While it was pretty straightforward to write an API endpoint that adapts between the API and provides Prismic with the expected shape, it could make this feature more accessible to ingest the data on Prismic's side.

Click to see the example data from the help article

Set up Integration Fields - Prismic

{
  "results_size": 1,
  "results": [
    {
      "id": "1",
      "title": "Item Title",
      "description" : "Description of the item.",
      "image_url" : "https://images.unsplash.com/photo-1577401239170-897942555fb3?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1600&q=80",
      "last_update" : 1509364426938,
      "blob": {
        "sku": "1",
        "title": "First item",
        "description": "Description of first item.",
        "image_url": "https://images.unsplash.com/photo-1577401239170-897942555fb3?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=1600&q=80"
      }
    }
  ]
}

Essentially, I'd imagine a UX similar to a CSV importer. Since Prismic expects certain fields, the setup frontend could pull an example record from the API endpoint that the user provided, and let the user select the data points from a dropdown. A simple matching process. Let's imagine we had this dummy record:

{
 unique_id: "340809324",
 data: {
  title: "Title",
  description: "This is the description",
  other: "This is some other data",
  modified: "2022-02-01T23:16:49.012Z"
 },
 image: {
  full: [
   {
    url: "https://example.com",
    alt: "",
   }
  ],
  thumbnail: [
   {
    url: "https://example.com",
    alt: "",
   }
  ]
 }
}

The setup UX would prompt the users to match the right keys with the fields Prismic requires:


Then, the Prismic backend would use these matched datapoints to choose which data to display. You may need a similar selection prior to this for the "results" array. You would also need to limit dates to formats supported by JavaScript most likely, so they can be easily parsed to the format Prismic needs to display them. The blob selection could have an additional option of "entire record" at the top to include all object data in subsequent API requests. Pagination would need some thought, but I can imagine that raising the limit for this method would be reasonable, then handling the pagination logic within Prismic could be possible? There could be hard limits on record size when using this method, or some other restrictions. That way most users would still benefit from an easy setup without managing their own API infrastructure or serverless setups to accommodate for the current requirements.

Thank you for your consideration. I'm happy to provide further details if needed.

Thanks for this detailed suggestion, @baltair! I'll share it with the product team, and I'll leave the thread open so that others can add their own thoughts or questions :slight_smile:

Sam

1 Like