web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Microsoft Lists - Doma...
Power Automate
Answered

Microsoft Lists - Domain Emails

(0) ShareShare
ReportReport
Posted on by 19

Hey everyone,

 

so I’m currently in the midst of building out a power app application to help modernise our expense reporting. 

We’ve had a to make a shift on where the data is being stored from originally wanting to build the power app using dataverse as our backend and now we are using Microsoft Lists. 

Anyways, everything has been going great however one issue we are coming across similar to dataverse is I want to only allow team members to see their own expenses rather than everyone else’s in the company. To do this I have used the following code which limits expenses to be seen by the user who created the item 

 

SortByColumns(
Filter(
[@'Expense Report'],
StartsWith(Title, TextSearchBox1.Text) && 'Created By'.Email = User().Email
),
"Title",
If(SortDescending1, SortOrder.Descending, SortOrder.Ascending)
)

 

the ‘Created By’ column email address is pulling a domain email address (for example if Joe bloggs where to create an expense it would pull joebloggs@waterfront.co.uk or joebloggs@belfasticc.co.uk)

 

However users will login to the power apps using another domain (joebloggs@Belfastcity.co.uk) which means that they won’t see their expenses due to the email addresses not matching

 

Is there a way with using power automate to take the data from the SharePoint list -> ‘Created By’ column and converting the domain name in another column called ‘transformed email’ 

 

e.g. joebloggs@waterfront.co.uk (created by Column data) ->joebloggs@belfastcity.co.uk (transformed email column data)

 

This way all I need to do is change the code to reflect the new column

 

Really appreciate any advice on how to do this!

 

Thanks,

Matthew

Categories:
  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,396 Most Valuable Professional on at

    @mmcgookin 

    You could use split function to match the value after removing the domain name

    SudeepGhatakNZ_0-1712713472839.png

     

     

     

  • mmcgookin Profile Picture
    19 on at

    Hey Sudeep, 

     

    Thank you so much for getting back to me, this is amazing!

     

    We did encounter another problem after testing with my colleague due to the initial setup of their accounts. When my colleague joined the company, her email address was set up as... 

     

    • [surname][first initial of first name]@waterfront.co.uk
    • [surname][first name]@belfastcity.co.uk

    I believe that this only affects a small number of our users however to ensure that this functionality works for all users, I made a slight adjustment to your code by adding the office365users data source and all seems to be working exactly as we need it!

     

    SortByColumns(
        Filter(
            [@'Expense Report'],
            First(
                Split(
                    'Created By'.Email,
                    "@"
                )
            ).Value = First(
                Split(
                    Office365Users.MyProfile().Mail, 
                    "@"
                )
            ).Value
        ),
        "Title",
        If(
            SortDescending1,
            SortOrder.Descending,
            SortOrder.Ascending
        )
    )
     
    I really appreciate this Sudeep, and thanks for sharing this with me! Have a great day 🙂
     
    Kind regards,
    Matthew

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 425

#2
11manish Profile Picture

11manish 323 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard