> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Activities

> How to work with activities in CRMScript.

You can also use [NSContactAgent][4] to check what's going on.

## GetMyActiveContacts

Here we get all activities that happened the last week for companies tied to the currently signed-in user.

You can filter by category and action type.

<Tip>
  Set the start time to a future date to get all activities since the last sign-in.
</Tip>

```crmscript! theme={null}
NSContactAgent contactAgent;

DateTime start;
Integer[] categories; // ignore filter

NSContactActivity[] activities = contactAgent.GetMyActiveContacts(start.addDay(-7), categories, 63);

for (Integer i = 0; i < activities.length(); i++) {
  NSContactActivity a = activities[i];
  printLine("At " + a.GetActionTime().toString() + ", " + a.GetActivityPersonName() + " did something to " + a.GetName());
}
```

## NSContactSummary GetContactSummary(Integer contactId, Integer limit)

Get a summary of a company's recent activity.

```crmscript! theme={null}
Integer contactId = 2;
NSContactAgent agent;

NSContactSummary summary = agent.GetContactSummary(contactId, -1);

NSActivitySummaryItem[] followups = summary.GetFollowups();

for (Integer i = 0; i < followups.length(); i++) {
  printLine(followups[i].GetDate().toString());
}
```

<Tip>
  You can explore other collections in the activity summary too.
</Tip>

## Action types

| Value | Description        |
| :---: | :----------------- |
|   1   | created            |
|   2   | updated            |
|   4   | new activity       |
|   8   | activity completed |
|   16  | person added       |
|   32  | person updated     |

<Tip>
  To request more than one action type, summarize the values. **63** means **include all**.
</Tip>

[4]: ../../netserver/ns-agents-and-carriers


## Related topics

- [Activities](/en/learn/basics/activity.md)
- [Activity](/en/api/archive-providers/reference/activity.md)
