Field showing number of connected records?

Hi. I have a table of processes. Each process may have Risks related to it. And Non Conformities. And Improvement Opportunities. Etc.

From the main table I want to show a count of how many risks, NCs and IOs that Process has.

I know there are two automations for records in a related table. One can sum up values of the related table. The other can count the values of the related table.

I messed up a little with the one that can count the values of the related table but I have no idea how to put that value anywhere I can see.

I can create a trigger that will run the automation every time the related table (Example, risks) has a new record created.

Ok.

Then the automation let’s me choose a field to count, based on a condition. So let’s say I can records from the Risks table for any record where the Connected Table ID equals… hmmm, the ID of the main table records?

Ok, but the automation doesn´t let me choose any place to “throw” that number.

I am a bit at a loss here…

Trigger and Action
image

Trigger
image

Automation

So… he is counting from RiscosMain all records with Tipo de Risco (Field) = “Processo” AND Processo (field) equal IdProcesso

So… where is the number being counted going?

I mean, the Update Quantities from Connected Tables has a field where you tell WHERE the value of the sum is going.

I guess I am going to use it.

Each record in the child table will have a calculated field =1. And the Update Quantities will sum all those 1s.

Hey @RogerPenna

It comes back as a variable for the next actions, this field is made specifically because sometimes you don’t want to update something, but if you create an update action later, for example, it can use this number.

So you have to create an update action later and this variable will be there in the “insert data” options for you to select and update a field of your choice