cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PowerAutomate4
Frequent Visitor

Created By Email from Sharepoint list not usable to create Team

Hi all,

 

I have a Sharepoint list and connected this to Power Automate. One of the steps from this flow is to create a new team (for Teams) and add the user who creates a new item in the Sharepoint list as owner of this new team.  Normally one would use the "Created By Email" to achieve this (as in the screenshot below):

 

Screenshot_1.png

 

This is however not working for our environment because our users are having different primary SMTP email domains which are different then the email logon in Microsoft 365. The flow returns a "unknown user" error. The flow only works if the primary email is the same as the logon email from Microsoft 365.

 

I hope someone allready fixed this issue.

 

Many thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
Expiscornovus
Super User
Super User

Hi @PowerAutomate4,

 

You only have to amend the expression when your action which is retrieving the e-mail has a different name. That Get Item after outputs refers to the name of the action not the field. The outputs function its format is outputs('Name of action').

 

Author/Claims is the internal name of the Created by Claims field which is part of the body. So, it shouldn't be necessary to amend the part after the '?'.

 

From the screenshot it also looks like you directly pasted the code in the value field. Can you paste that code into the expression editor instead? 

 

If you are using the newer expression editor interface it will look like below

 

expressioneditor_copypasting_newinterface.png

 

When you are using the older expression interface you will probably see something like below.

 

expressioneditor_copypasting.png

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


View solution in original post

7 REPLIES 7
Expiscornovus
Super User
Super User

Hi @PowerAutomate4,

 

Have you tried the Created by Claims field of the user. That might contain the correct e-mail. I would also use a Get user action to retrieve the AAD ID from Azure Active Directory btw.

 

Below is an example.

 

1. Get AD User. Use a split function to only retrieve the e-mail from the claim value.

 

split(outputs('Get_item')?['body/Author/Claims'], 'membership|')[1]

splitclaims.png

 

2. Use Id in the Add a member to team action

 useidinaddteamsmember.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Thanks for the fast reply! I tried the "Created by Claims" field already but that doesn't work.

The output is 'i:0#.f|membership|user@domain.tld'

Where user@domain.tld is also not the primary SMTP address. So this email is not good to use in the AAD ID field also.

 

But I like your solution to get the AAD ID from the "Get user"  function. But i don't see this "Get user" function?

Is this possible?

Expiscornovus
Super User
Super User

Hi @PowerAutomate4,

 

Should be part of the Azure AD connector. First look for Azure AD. Select it and look for Get User.

https://docs.microsoft.com/en-us/connectors/azuread/#get-user

 

Btw, that action requires User Id (which we don't know yet) or the User Principal Name. So, if you know the UPN of your Created By User you could use the Get User to retrieve the correct User Id.

 

azuread_getuser.png



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


Hi! 

I found the function. Thanks!

I did see that the "Created by Claims" email field is good after all. I mistaked here. So this field is usable.

 

I will give it try and let you know.

 

Thanks! Appreciate your help!

PowerAutomate4
Frequent Visitor

I have tested your solutions with the "Get User" function but I receive this error:

 

PowerAutomate4_0-1636723926910.png

"message""Bad Request - Error in query syntax."

 

I used the 'Created By Claims'" instead of the 'Get_item'

I also get the syntax error when I use your original code.

Expiscornovus
Super User
Super User

Hi @PowerAutomate4,

 

You only have to amend the expression when your action which is retrieving the e-mail has a different name. That Get Item after outputs refers to the name of the action not the field. The outputs function its format is outputs('Name of action').

 

Author/Claims is the internal name of the Created by Claims field which is part of the body. So, it shouldn't be necessary to amend the part after the '?'.

 

From the screenshot it also looks like you directly pasted the code in the value field. Can you paste that code into the expression editor instead? 

 

If you are using the newer expression editor interface it will look like below

 

expressioneditor_copypasting_newinterface.png

 

When you are using the older expression interface you will probably see something like below.

 

expressioneditor_copypasting.png

 



Happy to help out! 🙂

Interested in more #PowerAutomate #SharePointOnline or #PowerVirtualAgents content?
Visit my blog, Subscribe to my YouTube channel or Follow me on Twitter


My bad...it works fine. I also found this solution to get the email from the "Created by Claims"

 

last(split(triggerOutputs()?['body/Author/Claims'],'|'))

 

Thanks again. Have a nice weekend!

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Community Calls Conversations

Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (2,268)