How to retrive data from association ?

I have one entity called Deviceinfo that contain device information. I associated this entity to history 1 to many.i try to retrieve data from association in microflow.but i get empty list.please guide me the correct way to retrive data from association in microflow.
3 answers

Hi Hemali Raval,


We can retrieve using association. Before that, we have to associate the object to the other entity objects.


So that a record of DeviceInfo has associated with a list of history records.


Remember that By association retrieve only retrieve objects when they are associated.


Without associating it will not retrieve any records. It will retrieve empty list or objects.



Just make sure while saving the history of your device information, you are setting an association and committing the object or not.


Hope it helps!


Hi Hemali Raval,

  1. Create a Microflow:

    • First, create a new microflow in your Mendix app.
  2. Add a Retrieve Activity:

    • Drag and drop a “Retrieve” activity into your microflow.
    • Configure the properties of the Retrieve activity as follows:
      • Source: Choose “By association.”
      • Association: Specify the association you want to follow (in your case, the association between DeviceInfo and the history table).
      • Entity: Select the entity you want to retrieve instances from (e.g., History).
      • XPath Constraint: Define any conditions for the objects you want to retrieve (optional).
  3. Use the Retrieved Data:

    • After retrieving the data, you can use it in subsequent activities within your microflow.

Remember that when using “Retrieve by Association,” the data may not be committed to the database yet. I hope this helps! 😊