REST API: Populate a foreign key on an entity from the ID of a referenced entity
Cédric BLANC
started a topic
over 2 years ago
I am loading entities with the REST API. I want to populate the foreign key from the id of a referenced entity. I have a column "Content_Name" in the "Content_Edition" entity which can match the "Name" of the "Content" entity. The entities are basic and have UUID keys. Is there a way to do this on load using the REST API?
Best Answer
C
Cédric BLANC
said
over 2 years ago
For the REST API, you must always have the value for FID. The API does not filter through one entity and populate the value in another. For SQL you could do something like this which can take the value from one table and populate into another.
INSERT INTO dev4_test_mdm.sa_email_plugin_test
(b_loadid, id, b_classname, email_recipient, email_body, email_subject)
select dev4_repo.get_continuous_loadid('NOTIFICATION_EMAIL'), nextval('seq_email_plugin_test'), 'EmailPluginTest', 'fathia.jama@semarchy.com', 'Changes were made by ' || b_updator , 'Changes were made to ' || t.test_name
from sa_test t;
1 Comment
Cédric BLANC
said
over 2 years ago
Answer
For the REST API, you must always have the value for FID. The API does not filter through one entity and populate the value in another. For SQL you could do something like this which can take the value from one table and populate into another.
INSERT INTO dev4_test_mdm.sa_email_plugin_test
(b_loadid, id, b_classname, email_recipient, email_body, email_subject)
select dev4_repo.get_continuous_loadid('NOTIFICATION_EMAIL'), nextval('seq_email_plugin_test'), 'EmailPluginTest', 'fathia.jama@semarchy.com', 'Changes were made by ' || b_updator , 'Changes were made to ' || t.test_name
from sa_test t;
Cédric BLANC
I am loading entities with the REST API. I want to populate the foreign key from the id of a referenced entity. I have a column "Content_Name" in the "Content_Edition" entity which can match the "Name" of the "Content" entity. The entities are basic and have UUID keys. Is there a way to do this on load using the REST API?
For the REST API, you must always have the value for FID. The API does not filter through one entity and populate the value in another. For SQL you could do something like this which can take the value from one table and populate into another.
Cédric BLANC
For the REST API, you must always have the value for FID. The API does not filter through one entity and populate the value in another. For SQL you could do something like this which can take the value from one table and populate into another.
-
Import Data Into Entities via Azure Data Lake
-
Recover Deleted(soft Delete) Record and Configure in Application
-
Data Quality in batch mode and real-time integration
-
Integration with analytics tools
-
Query/Load/Delete data with the REST API
-
Does the Done Tab in Inbox have a limit?
-
How Can I Trigger Enricher or Sql Procedure when deleting?
-
Matching Rules But Only The Latest Record Creates a Golden Record
-
Unstructured and Semi Structured Data in Semarchy?
-
Read CSV files from AWS S3
See all 73 topics