# Model Lookup w/ Multiple Aggregate Models

Josef Lagorio
Member

I am trying to combine multiple aggregate models(task object) into one table via model lookup formula fields. The end goal is to have the main aggregate model display row data by user and have individual columns be the source of the other aggregate models (Image below).

The Model Lookup formula I am using on Type A is as follows:

VALUE(MODEL_LOOKUP("TypeA","countId","createdByName",{{CreatedBy.Name}}))

This UI field for the main task model is returning no results.

If I modify the formula to:

VALUE(MODEL_LOOKUP("TypeA","countId")) then I will see the first-row entry for TypeA displayed across all rows in my main task model. I've tried every combination for parameters 3 and 4, but nothing I do seems to make the models match up by the grouping field.

Column Task Model (Type A in this example)

Main Task Model (User in this example)

Main Task Model Formula Field

- User entries are the main Task aggregate model.
- Each Type column is a separate Task aggregate model

The Model Lookup formula I am using on Type A is as follows:

VALUE(MODEL_LOOKUP("TypeA","countId","createdByName",{{CreatedBy.Name}}))

This UI field for the main task model is returning no results.

If I modify the formula to:

VALUE(MODEL_LOOKUP("TypeA","countId")) then I will see the first-row entry for TypeA displayed across all rows in my main task model. I've tried every combination for parameters 3 and 4, but nothing I do seems to make the models match up by the grouping field.

Column Task Model (Type A in this example)

Main Task Model (User in this example)

Main Task Model Formula Field

Tagged:

1

## Comments

The 4th parameter of the lookup statement needed the alias name from the main model, not the field API name. Woot!