Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,55 +1,70 @@
> ### **1 minute read                                                                                                                         `Begineer`**
<h3>
<table>
<tr>
<td><b>5 minute read</b></td>
<td style={{ paddingLeft: 40 }}><b>Level: Beginner</b></td>
<td style={{ paddingLeft: 40 }}><b>Last updated: August 2025</b></td>
</tr>
</table>
</h3>

___
---

**On the basis of the response of the contact, you can save the contact in a collection which you have created earlier. This feature can be used for categorizing the various incoming contacts into separate buckets based on their divergent attributes**
**`Collections` will help to group contacts based on their specific criteria or location to enable targeted campaigns, surveys, or follow-ups.**

---
## Prerequisites
- [Flows](https://glific.github.io/docs/docs/category/flows)
- [Collections](https://glific.github.io/docs/docs/Product%20Features/Others/Collections)
**The `Add to Collection` and `Remove from Collection` actions in a flow automatically include or exclude contacts from a collection as they move through the flow. For detailed guidance, refer to the complete [documentation](https://glific.github.io/docs/docs/Product%20Features/Others/Collections/) on `Collections`.**

---
## Add Contacts to a Collection
**Examples:**

1. Select `Add to Collection` type from the node. Select the collection in which contact needs to be added.
- Add to Collection: When a contact provides consent to receive future messages, the contact can be added to an Opt-in collection.
If a contact shares a location preference, such as Maharashtra, the contact can be added to a Maharashtra collection.

- Remove from Collection: When a contact completes a feedback survey or an activity for a specific week or month, the contact can be removed from the Feedback collection.

Comment on lines +16 to +22
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix list structure and typos in “Examples” (missing bullet, double-space, clarity)

The second example line is detached from its bullet and there’s a double space in “Feedback collection.” Nested bullets improve readability.

-**Examples:**
-
-- Add to Collection: When a contact provides consent to receive future messages, the contact can be added to an Opt-in collection.
-If a contact shares a location preference, such as Maharashtra, the contact can be added to a Maharashtra collection.
-
-- Remove from Collection: When a contact completes a feedback survey or an activity for a specific week or month, the contact can be removed from the Feedback  collection.
+**Examples**
+
+- Add to Collection:
+  - When a contact provides consent to receive future messages, add them to an "Opt-in" collection.
+  - If a contact shares a location preference (e.g., "Maharashtra"), add them to a "Maharashtra" collection.
+
+- Remove from Collection:
+  - When a contact completes a feedback survey or an activity for a specific week or month, remove them from the "Feedback" collection.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
**Examples:**
1. Select `Add to Collection` type from the node. Select the collection in which contact needs to be added.
- Add to Collection: When a contact provides consent to receive future messages, the contact can be added to an Opt-in collection.
If a contact shares a location preference, such as Maharashtra, the contact can be added to a Maharashtra collection.
- Remove from Collection: When a contact completes a feedback survey or an activity for a specific week or month, the contact can be removed from the Feedback collection.
**Examples**
- Add to Collection:
- When a contact provides consent to receive future messages, add them to an "Opt-in" collection.
- If a contact shares a location preference (e.g., "Maharashtra"), add them to a "Maharashtra" collection.
- Remove from Collection:
- When a contact completes a feedback survey or an activity for a specific week or month, remove them from the "Feedback" collection.
🤖 Prompt for AI Agents
In docs/3. Product Features/03. Flows/2. Flow Actions/08. Add or Remove the
contact to a collection.md around lines 16 to 22, fix the list structure by
ensuring the second example line is properly indented as a nested bullet under
"Add to Collection" and remove the double space in "Feedback  collection." Also,
improve clarity by using nested bullets for related examples to enhance
readability.


---
## Add Contacts to a Collection

<img width="578" alt="image" src="https://github.com/glific/docs/assets/143380171/cf781020-0c71-4523-a91a-c82c13d5d844"/>
1. Open your flow

2. Drag the red dot under the node and search for the node `add contact to the collection` where you want the contact to be added to a collection.

3. Select an existing collection from the dropdown.
You can also create a collection while adding the collection node in the flow if one doesn’t already exist.

<img width="661" alt="image" src="https://github.com/glific/docs/assets/143380171/ee9daa0e-2d86-48c7-9e77-b878c6aad30b"/>

4. Click on Ok and publish your flow.

<img width="565" height="405" alt="image" src="https://github.com/user-attachments/assets/b4ebd8f1-6080-45cd-8a16-6520460299b3" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Verification agent

🧩 Analysis chain

Use repo-hosted images with descriptive alt text; avoid fixed dimensions

“user-attachments” links are brittle, and width/height break responsive layouts. Prefer Markdown image syntax with a repo-hosted asset and a meaningful alt.

-<img width="565" height="405" alt="image" src="https://github.com/user-attachments/assets/b4ebd8f1-6080-45cd-8a16-6520460299b3" />
+![Add contact to a collection action in a flow](../assets/flows/actions/add-to-collection.png)

If the asset isn’t in the repo yet, please add it under the docs’ images/static folder and update the path accordingly.

To find any remaining external “user-attachments” links:


🏁 Script executed:

#!/bin/bash
rg -n "user-attachments/assets" -A 1 docs

Length of output: 69951


Replace external images in flow actions with repo-hosted assets

The file docs/3. Product Features/03. Flows/2. Flow Actions/08. Add or Remove the contact to a collection.md still contains two <img> tags pointing at github.com/user-attachments with hard-coded width/height. These links are brittle and break responsive layouts. Please:

• Copy both screenshots into your docs repo under docs/images/flows/actions/
• Remove the <img> tags and use Markdown syntax with descriptive alt text (omit fixed dimensions)

Updated diff for lines 37 and 62 in that file:

-<img width="565" height="405" alt="image" src="https://github.com/user-attachments/assets/b4ebd8f1-6080-45cd-8a16-6520460299b3" />
+![Add contact to a collection action in a flow](../images/flows/actions/add-to-collection.png)

-<img width="562" height="336" alt="image" src="https://github.com/user-attachments/assets/08d5091b-af7e-43cc-8e9a-6aadbc732692" />
+![Remove contact from a collection action in a flow](../images/flows/actions/remove-from-collection.png)

To ensure no external attachments remain, run:

rg -n "user-attachments/assets" -A 1 docs
🤖 Prompt for AI Agents
In docs/3. Product Features/03. Flows/2. Flow Actions/08. Add or Remove the
contact to a collection.md at lines 37 and 62, replace the existing <img> tags
that reference external github.com/user-attachments URLs with Markdown image
syntax using local copies of those images stored in docs/images/flows/actions/.
Remove the fixed width and height attributes and provide descriptive alt text
for each image. This will prevent broken links and improve responsive layout
handling.


2. Execute the flow.
---
### What Happens When the Same User Passes Through This Node Again?

If a user passes through the Add to Collection node again in the same or another flow, they will not be added twice to the collection. Each contact can appear only once in a collection.

### How to Verify If the Contact Was Added to the Collection

<img width="1332" alt="image" src="https://github.com/glific/docs/assets/143380171/7372b655-ea8a-466b-85fd-dc8da8ef8628"/>
1) Go to the left panel in the Glific Platform Manage >> Collections page from the left menu.

2) Search for the collection name you used in the flow.

3) Click on the collection and you will see the list of contacts who have been added to it.

3. Verify the contact is added to the collection. Click on `Manage` menu from the left panel and then click `Collections`,`View Details` from the collection tile.
---
## Remove the contact from a Collection

<img width="145" alt="Screenshot 2024-03-05 at 4 03 19 PM" src="https://github.com/glific/docs/assets/143380171/f6ad0fff-9af2-4437-a320-56a5ed94e02c"/>
**Removing contacts from a collection is useful when they no longer meet the criteria for being in that group.
For example: If someone cancels their registration for an event, you can remove them from the “Registered Participants” collection.**

### How to Remove a Contact from a Collection

<img width="1011" alt="image" src="https://github.com/glific/docs/assets/143380171/f3625904-d442-4d48-918e-0a6bff427fa0"/>
1. In your flow, click on the red dot under a node and search for the node to “remove the contact from a collection” when you want the contact to be removed from the collection.

4. Once you click on `View Details` from the collection tile you will be able to find how many contacts are present in the collection.
<img width="562" height="336" alt="image" src="https://github.com/user-attachments/assets/08d5091b-af7e-43cc-8e9a-6aadbc732692" />

<img width="1023" alt="image" src="https://github.com/glific/docs/assets/143380171/90dcb765-ab85-4acd-958c-9f99e252a7e9"/>
2. Select the collection name from the drop down.

---
## Remove the contact from a Collection
3. You can also check the box remove from all this action will remove the contacts from all the collections where it has been added.
Comment on lines +60 to +66
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Tighten grammar, fix double-space, and use consistent terminology (“dropdown”, “Remove from all collections”)

This block has a double-space, awkward phrasing, and unclear checkbox label.

-1. In your flow, click on the red dot under a node and search for the node to “remove the  contact from a collection” when you want the contact to be removed from the collection.
+1. In your flow, click the red dot under a node and add the “Remove contact from a collection” action where the removal should happen.
@@
-2.  Select the collection name from the drop down.
+2. Select the collection name from the dropdown.
@@
-3. You can also check the box remove from all this action will remove the contacts from all the collections where it has been added.
+3. To remove the contact from every collection they belong to, check “Remove from all collections.”
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
1. In your flow, click on the red dot under a node and search for the node to “remove the contact from a collection” when you want the contact to be removed from the collection.
4. Once you click on `View Details` from the collection tile you will be able to find how many contacts are present in the collection.
<img width="562" height="336" alt="image" src="https://github.com/user-attachments/assets/08d5091b-af7e-43cc-8e9a-6aadbc732692" />
<img width="1023" alt="image" src="https://github.com/glific/docs/assets/143380171/90dcb765-ab85-4acd-958c-9f99e252a7e9"/>
2. Select the collection name from the drop down.
---
## Remove the contact from a Collection
3. You can also check the box remove from all this action will remove the contacts from all the collections where it has been added.
1. In your flow, click the red dot under a node and add the “Remove contact from a collection” action where the removal should happen.
<img width="562" height="336" alt="image" src="https://github.com/user-attachments/assets/08d5091b-af7e-43cc-8a16-6520460299b3" />
2. Select the collection name from the dropdown.
3. To remove the contact from every collection they belong to, check “Remove from all collections.”
🤖 Prompt for AI Agents
In docs/3. Product Features/03. Flows/2. Flow Actions/08. Add or Remove the
contact to a collection.md around lines 60 to 66, tighten grammar and spacing,
replace the phrase "remove the  contact from a collection" with "remove the
contact from a collection" (remove double-space), change "drop down" to the
single word "dropdown", and reword the checkbox description to a consistent
label such as "Remove from all collections" and a clearer sentence like "You can
also check the box labeled 'Remove from all collections' to remove the contact
from every collection it belongs to."


**You can view how & when a contact was added or removed to a collection or any other contact related activity on Glific. You can check this information in the contact profile along with all the other contact related information.**
4. Click on ok and publish your flow.

---
## Tags
- Add beneficiaries to a Collection (automatically from a flow)

- Adding contacts to a collection