Set custom association between entities populated importing data from an external data source (DB or Excel or CSV)

New to Mendix here. I would like to create a Mendix app that use data imported from the company CRM. The data source tables are associated with ID fields. Let’s say:         Table1: t1ID, t1field1, t2ID         Table2: t2ID, t2field1, t2field2 Table1 is associated to Table2 with the field t2ID For what I understood, in Mendix, associations between records in entities are done automatically when you enter data through Mendix forms, but how can I declare an association for imported data? When you set an association in the domain model, you simply join two entities. You cannot declare which are the related attributes. How can I set the association with t2ID? Thank you for any help. Andrea
1 answers

In the domain model you can specify relations between entities.  To associate 2 objects, you need some logic in you application, e.g. in Mendix forms you can use reference selectors to select the related objects. You can also set associations in microflows with use of the change object activity. See also documentation on and the learnings on

In your case you need some logic in your import. How do you import your data? If you do this via API's and you use import mappings, you can specify how objects are linked and which associations need to be set. See here some documentation:

If you use the excel importer: see the documentation of the module: