Searching for someone not in a relationship
Clash Royale CLAN TAG#URR8PPP
up vote
2
down vote
favorite
We're using CiviCRM to primarily build a network of activist groups around the country. There are "area organisers" and people they are linked with. We are using the relationship function to link people together.
It would be really helpful to be able to search for people who haven't yet been linked to an area organiser (because there isn't one yet in their locality), but I can only work out how to search for relationships between specific individuals. Is there a way to search for everyone who doesn't yet have a relationship with anyone else in the database?
search relationships
add a comment |Â
up vote
2
down vote
favorite
We're using CiviCRM to primarily build a network of activist groups around the country. There are "area organisers" and people they are linked with. We are using the relationship function to link people together.
It would be really helpful to be able to search for people who haven't yet been linked to an area organiser (because there isn't one yet in their locality), but I can only work out how to search for relationships between specific individuals. Is there a way to search for everyone who doesn't yet have a relationship with anyone else in the database?
search relationships
add a comment |Â
up vote
2
down vote
favorite
up vote
2
down vote
favorite
We're using CiviCRM to primarily build a network of activist groups around the country. There are "area organisers" and people they are linked with. We are using the relationship function to link people together.
It would be really helpful to be able to search for people who haven't yet been linked to an area organiser (because there isn't one yet in their locality), but I can only work out how to search for relationships between specific individuals. Is there a way to search for everyone who doesn't yet have a relationship with anyone else in the database?
search relationships
We're using CiviCRM to primarily build a network of activist groups around the country. There are "area organisers" and people they are linked with. We are using the relationship function to link people together.
It would be really helpful to be able to search for people who haven't yet been linked to an area organiser (because there isn't one yet in their locality), but I can only work out how to search for relationships between specific individuals. Is there a way to search for everyone who doesn't yet have a relationship with anyone else in the database?
search relationships
search relationships
asked 4 hours ago
Andrew Metheven
363
363
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
2
down vote
One way is to export two lists to Excel and then use the power of Excel to find the missing ones.
- Under Reports - Contact Reports, run the Relationship Report and under Columns check "Contact ID" so that it appears in the output.
- From the Actions dropdown export that to CSV.
- Under Reports - Contact Reports, run the Constituent Summary Report and under Columns check "Contact ID".
- From the Actions dropdown export that to CSV.
- Do something like described here to find the contact ids that are in the second list but not the first. Note you'll need to sort the lists by contact id first for this method to work.
https://www.extendoffice.com/documents/excel/3124-excel-compare-two-columns-for-missing-values.html#formula
There are other ways to do it in Excel if you don't like that one above. Search the internet for something like "how to tell which values are missing from two lists in excel". If you're using LibreOffice or similar I'm sure it can be done too.
add a comment |Â
up vote
1
down vote
While this isn't an ideal fix, it's a quick one if you know SQL:
- Create a new group called "Contacts without relationship".
- Note the group ID. You can find the group id by hovering the mouse over the "Contacts" link of the group on the Contacts û Manage Groups page. In the screenshot below, you can see that the group ID of "Summer Program Volunteers" is "3".
- Run this SQL statement:
SELECT '3', cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_a WHERE cr.id IS NULL AND cc.id IN (SELECT cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_b WHERE cr.id IS NULL) ORDER BY cc.id;
Replace the "3" above with YOUR group ID before you run it.
Now, everyone without a relationship will be in your group.
Screenshot for group ID (click to zoom):
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
add a comment |Â
up vote
0
down vote
Either you can create a custom report to achieve that or can be done through CiviCRM API in a module code.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
One way is to export two lists to Excel and then use the power of Excel to find the missing ones.
- Under Reports - Contact Reports, run the Relationship Report and under Columns check "Contact ID" so that it appears in the output.
- From the Actions dropdown export that to CSV.
- Under Reports - Contact Reports, run the Constituent Summary Report and under Columns check "Contact ID".
- From the Actions dropdown export that to CSV.
- Do something like described here to find the contact ids that are in the second list but not the first. Note you'll need to sort the lists by contact id first for this method to work.
https://www.extendoffice.com/documents/excel/3124-excel-compare-two-columns-for-missing-values.html#formula
There are other ways to do it in Excel if you don't like that one above. Search the internet for something like "how to tell which values are missing from two lists in excel". If you're using LibreOffice or similar I'm sure it can be done too.
add a comment |Â
up vote
2
down vote
One way is to export two lists to Excel and then use the power of Excel to find the missing ones.
- Under Reports - Contact Reports, run the Relationship Report and under Columns check "Contact ID" so that it appears in the output.
- From the Actions dropdown export that to CSV.
- Under Reports - Contact Reports, run the Constituent Summary Report and under Columns check "Contact ID".
- From the Actions dropdown export that to CSV.
- Do something like described here to find the contact ids that are in the second list but not the first. Note you'll need to sort the lists by contact id first for this method to work.
https://www.extendoffice.com/documents/excel/3124-excel-compare-two-columns-for-missing-values.html#formula
There are other ways to do it in Excel if you don't like that one above. Search the internet for something like "how to tell which values are missing from two lists in excel". If you're using LibreOffice or similar I'm sure it can be done too.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
One way is to export two lists to Excel and then use the power of Excel to find the missing ones.
- Under Reports - Contact Reports, run the Relationship Report and under Columns check "Contact ID" so that it appears in the output.
- From the Actions dropdown export that to CSV.
- Under Reports - Contact Reports, run the Constituent Summary Report and under Columns check "Contact ID".
- From the Actions dropdown export that to CSV.
- Do something like described here to find the contact ids that are in the second list but not the first. Note you'll need to sort the lists by contact id first for this method to work.
https://www.extendoffice.com/documents/excel/3124-excel-compare-two-columns-for-missing-values.html#formula
There are other ways to do it in Excel if you don't like that one above. Search the internet for something like "how to tell which values are missing from two lists in excel". If you're using LibreOffice or similar I'm sure it can be done too.
One way is to export two lists to Excel and then use the power of Excel to find the missing ones.
- Under Reports - Contact Reports, run the Relationship Report and under Columns check "Contact ID" so that it appears in the output.
- From the Actions dropdown export that to CSV.
- Under Reports - Contact Reports, run the Constituent Summary Report and under Columns check "Contact ID".
- From the Actions dropdown export that to CSV.
- Do something like described here to find the contact ids that are in the second list but not the first. Note you'll need to sort the lists by contact id first for this method to work.
https://www.extendoffice.com/documents/excel/3124-excel-compare-two-columns-for-missing-values.html#formula
There are other ways to do it in Excel if you don't like that one above. Search the internet for something like "how to tell which values are missing from two lists in excel". If you're using LibreOffice or similar I'm sure it can be done too.
answered 2 hours ago
Demerit
2,8941516
2,8941516
add a comment |Â
add a comment |Â
up vote
1
down vote
While this isn't an ideal fix, it's a quick one if you know SQL:
- Create a new group called "Contacts without relationship".
- Note the group ID. You can find the group id by hovering the mouse over the "Contacts" link of the group on the Contacts û Manage Groups page. In the screenshot below, you can see that the group ID of "Summer Program Volunteers" is "3".
- Run this SQL statement:
SELECT '3', cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_a WHERE cr.id IS NULL AND cc.id IN (SELECT cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_b WHERE cr.id IS NULL) ORDER BY cc.id;
Replace the "3" above with YOUR group ID before you run it.
Now, everyone without a relationship will be in your group.
Screenshot for group ID (click to zoom):
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
add a comment |Â
up vote
1
down vote
While this isn't an ideal fix, it's a quick one if you know SQL:
- Create a new group called "Contacts without relationship".
- Note the group ID. You can find the group id by hovering the mouse over the "Contacts" link of the group on the Contacts û Manage Groups page. In the screenshot below, you can see that the group ID of "Summer Program Volunteers" is "3".
- Run this SQL statement:
SELECT '3', cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_a WHERE cr.id IS NULL AND cc.id IN (SELECT cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_b WHERE cr.id IS NULL) ORDER BY cc.id;
Replace the "3" above with YOUR group ID before you run it.
Now, everyone without a relationship will be in your group.
Screenshot for group ID (click to zoom):
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
add a comment |Â
up vote
1
down vote
up vote
1
down vote
While this isn't an ideal fix, it's a quick one if you know SQL:
- Create a new group called "Contacts without relationship".
- Note the group ID. You can find the group id by hovering the mouse over the "Contacts" link of the group on the Contacts û Manage Groups page. In the screenshot below, you can see that the group ID of "Summer Program Volunteers" is "3".
- Run this SQL statement:
SELECT '3', cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_a WHERE cr.id IS NULL AND cc.id IN (SELECT cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_b WHERE cr.id IS NULL) ORDER BY cc.id;
Replace the "3" above with YOUR group ID before you run it.
Now, everyone without a relationship will be in your group.
Screenshot for group ID (click to zoom):
While this isn't an ideal fix, it's a quick one if you know SQL:
- Create a new group called "Contacts without relationship".
- Note the group ID. You can find the group id by hovering the mouse over the "Contacts" link of the group on the Contacts û Manage Groups page. In the screenshot below, you can see that the group ID of "Summer Program Volunteers" is "3".
- Run this SQL statement:
SELECT '3', cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_a WHERE cr.id IS NULL AND cc.id IN (SELECT cc.id from civicrm_contact cc LEFT JOIN civicrm_relationship cr ON cc.id = cr.contact_id_b WHERE cr.id IS NULL) ORDER BY cc.id;
Replace the "3" above with YOUR group ID before you run it.
Now, everyone without a relationship will be in your group.
Screenshot for group ID (click to zoom):
answered 22 mins ago
Jon G - Megaphone Tech
24.7k11766
24.7k11766
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
add a comment |Â
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
Nice. I might add cc.is_deleted = 0 to both the main and subqueries. And possibly restrict it to ACTIVE relationships, which might even require comparing end_date to the current date.
â Demerit
1 min ago
add a comment |Â
up vote
0
down vote
Either you can create a custom report to achieve that or can be done through CiviCRM API in a module code.
add a comment |Â
up vote
0
down vote
Either you can create a custom report to achieve that or can be done through CiviCRM API in a module code.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Either you can create a custom report to achieve that or can be done through CiviCRM API in a module code.
Either you can create a custom report to achieve that or can be done through CiviCRM API in a module code.
answered 3 hours ago
Hassan Farooq
508110
508110
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fcivicrm.stackexchange.com%2fquestions%2f27240%2fsearching-for-someone-not-in-a-relationship%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password