Technology Blog Posts by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
JuanNoah
Associate
Associate
599

If you're working in a large SAP BTP landscape, you've probably run into this: there's a subaccount with dozens of users, but no one quite remembers who they are or why they're there. Especially in shared or test environments, people get access for one-off projects, evaluations, or just to "check things out" - and then never get removed.

In this blog post, I'll walk you through a simple way to:

  • pull a list of all users from a BTP subaccount
  • enrich that data with department and location info using Microsoft PowerAutomate
  • and send out personalized emails asking users why they're using the BTP tenant

It's lightweight, repeatable, and helped us get quick answers without any custom coding. Let's get started.

Step 1: Export the User List from BTP

First, head to the SAP BTP cockpit, go to Security → Users, and export the list as an Excel file.

JuanNoah_0-1747215019732.png

 

Sounds simple enough, but here’s the catch: all the user info is dumped into a single cell per row, separated by commas. That’s not ideal for automation.

How to clean up the data in Excel:

  1. Open the Excel file
  2. Select the column with the user data (usually Column A)
  3. Go to the Data tab → click Text to Columns
  4. Choose Delimited → click Next
  5. Check Comma → click Finish

Now the email, name, ID provider, and so on are split into their own columns — much easier to work with.

Turn it into an Excel table:

  1. Select all your data
  2. Click Insert → Table
  3. Make sure “My table has headers” is checked → click OK
  4. (Optional) Rename the table under Table Design to something like BTP_Users

Next, create a second worksheet in the same file. Add another table there with headers like Name, Email, Department, Location — basically anything you plan to fill in later with PowerAutomate. This will be your “enriched” version of the user list.

Finally, upload the Excel file to OneDrive or SharePoint so PowerAutomate can read and write to it.

 

Step 2: Add Context with PowerAutomate

Now that you’ve got a structured user list, it’s time to add some context. Who are these users really? Which department are they from? Where are they located?

We’ll use Microsoft PowerAutomate to fetch that info from Microsoft 365 (Azure AD) and write it into the second table in your Excel file.

Here’s how to build the flow:

Trigger: Manually trigger a flow

This makes it easy to run whenever you need a fresh update.

JuanNoah_1-1747215019738.png

Connector: Excel Online (Business), Action: “List rows present in a table”

Point to the Excel table from Step 1 (the cleaned-up one).

JuanNoah_2-1747215019741.png

Add a loop:

PowerAutomate doesn’t loop through rows automatically, so:

  1. Add an “Apply to each” block
  2. Use the output from the previous step (body/value from the Excel table)

JuanNoah_3-1747215019743.png

Inside the loop:

Connector: Office 365 Users, Action: Get user profile (V2)

  • Use the user’s email from Excel as input
  • This pulls data like name, department, location, and more from Microsoft 365

JuanNoah_4-1747215019747.png

Connector: Excel Online (Business), Action: Add a row into a table

  • Point this to the second table you created
  • Write the original and new data (e.g., name, email, department, location) into the table

JuanNoah_5-1747215019752.png

That’s it — you now have a clean, enriched list of BTP users with helpful context.

 

Step 3: Reach Out with Personalized Emails

Now that you’ve enriched the user data with department and location info, the final step is to reach out to each user and ask about their current usage of the BTP tenant.

The great thing is — we don’t need to create a new loop or flow for this. We can simply add another action inside the same “Apply to each” loop from Step 2.

This keeps everything neat and compact in a single flow.

Here’s how to do it:

Inside the same “Apply to each” loop:

Right after the action where you add a row to the enriched Excel table, simply insert a new step:

Connector: Office 365 Outlook, Action: Send an email (V2)

You need to switch to Advanced Mode in order to use the data from excel.

  • To: Use the Email column from the current Excel row
  • Subject: (Customize this based on your use case)
  • Body: (Customize the content to match your tone and purpose)

JuanNoah_6-1747215019754.png

This approach doesn’t require any custom development and can be implemented in a few minutes. While our use case was a one-time check, the setup is flexible enough to be re-used or adapted for regular audits. It also helps foster transparency and accountability in shared BTP environments.

 

Let me know if you have questions, or feel free to adapt this idea for your own landscape!