Search for an ID in another entity and replace imported string with ID

0
Hi all, when importing data (in JSON format) I would like to search for the matching data in another entity and then create a reference or take the ID. What is the best way to implement this? Example: The following data is already stored in the database in the "Customers" entity: | _ID | CUSTOMER_NAME | AGE | |-----|---------------|-----| | 254 | customer-A | 35 | | 255 | customer-B | 42 | | 256 | customer-C | 37 | The following data is imported into the "Orders" entity via import mapping: { Orders: [ { "order": "Table", "price": 99.99, "customer": "Customer-C" }, { "order": "fork", "price":1.99, "customer": "customer-A" }, { "order": "bottle", "price":6.99, "customer": "customer-A" }] } The data (as a string) in "Customer" should be searched in the entity "Customers" and then only the integers should be returned, so that then the data is as follows in the entity "Orders" at the end: | _ID | ORDER | PRICE | CUSTOMER_ID | |-----|--------|-------|-------------| | 5 | table | 99,99 | 256 | | 6 | fork | 1,99 | 254 | | 7 | bottle | 6,99 | 254 | I think you have to search the data during import with a mircoflow from the corresponding entity and then return the corresponding ID, but I don't know how to do that. I also can't find a way to populate the association between the two entities ( "Customer" (1)-------(*) "Orders") - in the OverviewPage Order_NewEdit, mine can select a previously created customer.   
asked
1 answers
1

HI Jonathan,

I'm guessing you are using a import mapping to get your JSON data in to your domain. For to set the correct assocation you can use find object by key. See below for an example where this would be in the mapping properties of your customer element:

answered