# Workflow to export user list

**URL:** <https://community.dynatrace.com/t/workflow-to-export-user-list/55960>\
**Category:** Automations\
**Tags:** workflows\
**Created:** [May 20, 2026, 10:32am UTC](https://community.dynatrace.com/t/workflow-to-export-user-list/55960 "2026-05-20T10:32:35Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vasan](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@Vasan](https://community.dynatrace.com/u/Vasan)\
**Post date:** [May 20, 2026, 10:32am UTC](https://community.dynatrace.com/t/workflow-to-export-user-list/55960/1 "2026-05-20T10:32:35Z")

</div>

Can anyone share a workflow that extracts user list from Dynatrace? Ideally, we need the roles for each of the users as well in an excel spreadsheet that is emailed out.

---

<div class="post-metadata">

**Author:** ![dylan\_taelemans](https://dub1.discourse-cdn.com/dynatrace/user_avatar/community.dynatrace.com/dylan_taelemans/32/21501_2.png) [@dylan\_taelemans](https://community.dynatrace.com/u/dylan_taelemans)\
**Post date:** [May 26, 2026, 10:22am UTC](https://community.dynatrace.com/t/workflow-to-export-user-list/55960/2 "2026-05-26T10:22:51Z")

</div>

Hey Vasan,

Emailing an Excel spreadsheet is not possible using the default Mailing action, as it only supports a title + description in plain string (text) format and does not allow attachments.

What we can do instead is generate a CSV-formatted string. You can then simply copy-paste this into Excel.

I already have a base implementation for this that fetches all users and formats them into CSV.

### 🔧Required configuration in the JavaScript step

You will need to update the following part of the code:

```auto
await usersAndGroupsClient.getActiveUsersForOrganizationalLevel({
  levelType: "account",
  levelId: "ACCOUNTID",
  partialString: "@DOMAIN",
});

```

### 📌Replace these values:

**1. ACCOUNTID**  
You can retrieve this from:

> **[Account Management](https://myaccount.dynatrace.com/accounts)**
>
> Dynatrace Account Management provides an easier way to understand and manage licensing to optimize the value of Dynatrace to your organization. Learn more.

- Open your account
- The ACCOUNT UUID is visible in the URL
- Copy the UUID and replace ACCOUNTID in the code

Example:

```auto
https://myaccount.dynatrace.com/account/home?account-uuid=xxxxx-xxxx-xxxx-xxxx-xxxx

```

→ Use the xxxxx-xxxx-xxxx-xxxx-xxxx part as ACCOUNTID

* * *

**2. partialString: “@DOMAIN”**  
This is a required filter and must be at least 3 characters long.

You can use part of the email domain to filter results, for example:

- “@domain”
- “.eu”
- “.com”  
[mailing-all-users.workflow (1).json](https://community.dynatrace.com/uploads/short-url/4aDneiGugSIXubOtx2JLaeMVQLc.json) (2.12 KB)

---

<div class="post-metadata">

**Author:** ![Vasan](https://avatars.discourse-cdn.com/v4/letter/v/f1d935/32.png) [@Vasan](https://community.dynatrace.com/u/Vasan)\
**Post date:** [May 27, 2026, 8:57am UTC](https://community.dynatrace.com/t/workflow-to-export-user-list/55960/3 "2026-05-27T08:57:49Z")

</div>

Thanks, Dylan - will give it a whirl.
