Skip to main content
Nintex Community Menu Bar
Question

Render Conditions to include count of records in a related model

  • July 9, 2024
  • 5 replies
  • 17 views

Forum|alt.badge.img+3

I have a a need to render some different layouts depending on the number of child records on the parent object. e.g. if the parent has only 1 child, the page is shown as ‘one’, where we mash up the two records into a single view. Between 2 and 4 we nest the children below, and more than 4, we provide a list.

How do I create the render condition that queries the number of records in a model?

This topic has been closed for replies.

5 replies

Forum|alt.badge.img+13

Option 1: create a Roll-up Summary field on your parent model called “# of Children”, that just does a COUNT on the number of children. Then you could base your Render Conditions on the “# of Children” field on the parent Model.

Option 2: use JavaScript to listen for row creation / deletion events on the parent Model and then apply your own custom logic to decide which components to render / unrender. We can provide a code snippet for this if Option 1 won’t work, but I’d recommend Option 1, as it’s the path of least resistance.


Forum|alt.badge.img+3
  • Author
  • July 9, 2024

Thanks Zach! Will try for option 1 for now.


Forum|alt.badge.img+20

I’ve the same requirement but I’ve got just one table where the lookup is to itself. So Roll-up summary. Could I have that code snippet?


Forum|alt.badge.img+9
  • July 9, 2024

And I need to show a message when the number of child records is less than what is expected, which is based on a value on the parent record, and I can’t use a roll-up summary because this is to manage/count daily attendance records.


Forum|alt.badge.img+17
  • Nintex Employee
  • July 9, 2024

Note.  As of the Superbank release it is now possible to specify rendering conditions based on number of rows in a model.  If rows = 0 show component A,  If rows=1 show component B, if rows = 2 show component C etc.