I want to produce a report that lists all supervisors and their subordinates. (Assume that all Contacts have supervisors but not all Contacts have subordinates.) I plan to export the report to Excel and then use pivot tables to produce a hierarchical org. chart. What's the most efficient way for me, a non-coder with no SQL, to create the relationships in CiviCRM and include them in the Columns table of the new report? (CiviCRM 5.58.1 on Wordpress 6.2.2)
1 Answer
First create a new relationship type, then you can use SearchKit to find contacts with that relationship type and export in a CSV.
-
I haven't used relationships before. Is it correct that for this application I would have to create 2 relationships for each Contact: one to identify the supervisor and one to identify the subordinate(s)? Commented Jul 26, 2023 at 16:27
-
No, relationships are bi-directional. When you create 1 relationship between 2 contacts, it exists for both contacts.– ColemanCommented Jul 26, 2023 at 17:52
-
If it helps, think of the relationship as the piece of string that you attach one of the two ends of to each of the two people– petednz - fuzion ♦Commented Jul 26, 2023 at 19:48
-
I'm a little fuzzy on this. Isn't the particular case that I'm working on (supervisors with subordinates) different than the example of siblings given in the CiviCRM User Guide? I want to identify that John reports to Jane; it's never the case that Jane reports to John. These seem to be uni-directional relationships. What am I missing? (And thanks from this newbie for considering these elementary questions.) Commented Jul 26, 2023 at 23:55
-
Have a look at Child of / Parent of as an example, that's the same as Supervisor of / Subordinate of that you would create. When you create a relationship between two contacts, it is always bi-directional, Bob is the parent of Jill, Jill is the child of Bob, Mark is the supervisor of John, John is the subordinate of Mark (siblings is the same, Tom is the sibling of Julie, Julie is the sibling of Tom).– Lars SGCommented Jul 27, 2023 at 0:21