Using Slug as ID for record

Hi all,
we are developing our app on the paid plan. We would like to have the capability to import data from production into the development environment.

However, we noticed that the internal IDs of each record might change on import into the dev environment.

Can this be solved by using the Slug field as unique ID field and then create a manual ID for the Slug field when a record is created?

Since the Slug-ID would then be kept on import, we hope that all the data relations on import will work.

Maybe someone from the dev team can advise us.
Thanks!

The DB relationships aren’t using a slug or UID. Adding a slug won’t accomplish anything in terms of linking records in different environments.
You need to set up WFs to link data that you import to the correct records; or in the alternative, as a one-time import, can clone prod environment, but that comes along with its own admin.

@code-escapee sorry I could not follow your explanations. What are WFs in this context? (if workflows, what type of workflows?)?

regarding cloning prd environment: can this be done, to clone prd to tst including all the records?

Workflows that will find the appropriate data/records to link to (or in a dev environment can often be any records).

Prod can’t directly be cloned to dev but it can be to a 3rd environment.

OK, but for linking, will I not need to create my own IDs so that I actually which one to connect? Could the linking also be done via bubble API and record insert?

You can create your own IDs if you want to, but that’s a lot of work. You haven’t provided the relationship between tables and the link types and whether it can be arbitrary.

API insert can work but also not super simple (you can’t test creating records FROM dev unless you create in prod!).

Ok thanks. We found that even if providing another field as unique id, the relationships between the objects have to be constructed with the Unique ID provided by Bubble

yes that’s how a relationship DB works. What you seemed to be asking was how to determine which records to link to which records which using a slug or your own IDs can help the workflow determine which record to link (again only important if the link is important and can’t be arbitrary).
First, you gotta figure out what you’re trying to do and why…