web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Show count of connecti...
Power Apps
Unanswered

Show count of connections in Header

(0) ShareShare
ReportReport
Posted on by 1,164

Hi,

I want to show the number of connections a Contact record has in the Header Section of the Contact Form.

I went down the path of creating a Number column with rollup functionality but couldn't seem to find connections to be able to perform a count on them. Also want to show a zero if there are none.

Any ideas how I might achieve this? Or is there a better approach?

I dont want users having to click on the Related then Connections tab just to know if there is any.

Thanks in advance

Todd

I have the same question (0)
  • Jonathan Manrique Profile Picture
    2,687 on at

    Hi @Tango 

     

    You can add the Connections grid in a session and hide it from the form if you don't need it.
    Then create a number field and use Javascript to count the number of records associated with the grid.

     

    function obtenerConteoSubgrid(executionContext) {
     setTimeout(function () {
     var formContext = executionContext.getFormContext();
     if (formContext !== null && formContext !== undefined) {
     var nombreSubgrid = "nombre_del_subgrid"; // Reemplaza con el nombre real de tu subgrid
     var conteo = formContext.getControl(nombreSubgrid).getGrid().getTotalRecordCount();
     alert("Número de registros en el subgrid: " + conteo);
     }
     }, 15000); // Espera 15 segundos antes de ejecutar la función
    }
    

     

     

  • a33ik Profile Picture
    3,306 Most Valuable Professional on at

    Hello,

    There are multiple ways to address your scenario:

    1. You can create a regular (not rollup) whole number field and develop the set of plugins that will -  on Create  event of the record itself populate it with 0 and on create/delete events of connections perform the recalculation of that field.

    2. Use the same approach with the field and use Power Automate Flows to perform the recalculation. You will have to think about how to address the scenario when the connection record is deleted but I have an idea of how to make it happen cause I was doing something similar.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard