#Setting IDs when creating entries with Local API

2 messages · Page 1 of 1 (latest)

terse socket
#

Hi! I'm currently working on migrating an old project to Payload. I've already created a importer using the local api that allows me to import the old data as csv files. Because of relations between the data it's important that that the IDs are kept when importing the data. This works if I set a custom id field in my collections (https://payloadcms.com/docs/fields/overview#customizable-id)

However using a custom ID seems to have some downsides, because for new entries I'll have to set each id manually. I already tried to import my data using the custom field and converting it back aftewards, but this won't work because of incompatbilites between number and serial fields. Am I doing something wrong or does anyone have a idea how I can keep my IDs?

Payload CMS

Payload is a headless CMS and application framework built with TypeScript, Node.js, React and MongoDB

loud heartBOT