Is there anyway i can use a different ID as a table relationship value.
Options
Tim
Member ✭
I'm pretty new to all this.
So orders come in from our CMS every order has a customer.
I want to use the customer id that we already get from our CMS as the id instead of the standard customer id that the customer table has be default.
Is this possible?
Thanks
So orders come in from our CMS every order has a customer.
I want to use the customer id that we already get from our CMS as the id instead of the standard customer id that the customer table has be default.
Is this possible?
Thanks
Comments
-
You can display any field or fields that you want in a table reference through the auto-complete settings
Keep in mind that when calling data through the API, the table reference will be the ID reference to the related table. You can use Addons to decorate that reference with the data you want. -
Hey thanks for the reply.
I don't want just want display those fields there this is the number i want to reference to associate the relationship instead of the default id that is generated.
For example:
Order gets POST into DB from our CMS. The order already has a customer.id eg. 502154654654 i want to use this as id to reference the column in the customer table instead of the default generated id's 1,2,3,4,5,6,7, etc.etc.
I think it may be something like this?
https://www.geeksforgeeks.org/postgresql-identity-column/ -
There is a solution. You can set the shopify_id field in "customer" to have a unique index, which would allow it to act more like a primary key and make those lookups much more performant. You can also save that key in other tables as a regular value which will be able to do the lookup or joins on it with pretty good performance thanks to that unique index.
This is not exactly like the primary key. The relationships won't be enforced as a foreign key or displayed as a table reference, but you will get the functionality you are looking for! -
Thank you all. Much appreciated!
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback