Skip to main content
Nintex Community Menu Bar
Question

MODEL_LOOKUP - Default Return Value if Row is not found?

  • July 11, 2024
  • 5 replies
  • 17 views

Forum|alt.badge.img+10

What is the default return value for MODEL_LOOKUP if the row is not found in the model it’s searching? I’m trying to write a condition for the row not being found in a model.

This topic has been closed for replies.

5 replies

Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

Is this for a formula? I think you can use something like
IF(ISBLANK(MODEL_LOOKUP(“Opportunity”,“AccountId”,“AccountId”,{{Id}})),iftrue,iffalse)

If it fails to find a matching AccountId matching the Id in my main model, then it’ll do iffalse. If it successfully finds it, then it’ll do iftrue. Iftrue will probably be the model lookup you actually wanted to do, like if I wanted the oppty amount it would be MODEL_LOOKUP(“Opportunity”,“Amount”,“AccountId”,{{Id}}))


Forum|alt.badge.img+10
  • Author
  • Scholar
  • July 11, 2024

Thank you this works!


Forum|alt.badge.img+10
  • Author
  • Scholar
  • July 11, 2024

Another question – If there are multiple matching rows in the MODEL_LOOKUP, what happens? Does it just return the first row found?


Forum|alt.badge.img+10
  • Author
  • Scholar
  • July 11, 2024

I think I figured it out – It looks like it returns the first row found.


Forum|alt.badge.img+7
  • Nintex Employee
  • July 11, 2024

Yeah that makes sense - if you do a modellookup without criteria it just returns the first row of the model.