
Announcements
Hello everyone,
I'm designing an API layer that needs to update data within the dataverse. One thing that concerns me is the management of GUIDs. From what I understand, to populate the lookup field, I need to use the GUID of the row and cannot use the primary key of the row. Is what I'm saying correct?
Additionally, I wanted to ask something. Imagine the scenario where I have an order with lines inside as JSON. The lines have a lookup to the order. Now, if I use the dataverse APIs, will it return the GUID of the order just created? This is necessary for me because I don't want to make too many calls to the dataverse. Do you have any ideas on how I can retrieve this GUID? Thanks in advance.
Hello,
I'm not sure what you mean with "Primary Key" of the record. Technically, on the DB level "Primary Key" is the recordid that is Guid (for Account table - accountid field, for Contact table - contact e.t.c).
If you have some kind of external unique id you can use the feature that is called "Alternate Key" - https://learn.microsoft.com/en-us/power-apps/developer/data-platform/define-alternate-keys-entity
It would be possible to rely on that key and perform an upsert operation for records and use it to populate lookups in the related records.
When the record is created - id of the record is returned in response so you can rely on it.