cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mobilismexico
Resolver I
Resolver I

add guest member to an Office 365 Group

My goal is to add an external email address as a Guest member to an Office 365 Group. I need help transforming the email address string to the form user_domain#tenant.onmicrosoft.com.

Say for example that my guest's email address is john@msn.com

I have confirmed that the Add member to group block allows to add john_msn.com#EXT#contoso.onmicrosoft.com to an Office 365 Group in the Contoso tenant, as follows:

mobilismexico_0-1628876566795.png

So far I have been able to assign john to a string variable with these blocks:

mobilismexico_1-1628876813707.png

I know that I can obtain the domain string by simply extracting a substring starting from character @ for a length of total length minus "@position". This is where I'm stuck. From there I would only need to append my substrings in the right order:

user_domain#EXT#tenantconstant.onmicrosoft.com

 

What expressions should I use inside what blocks to accomplish this?

 

Thank you in advance!

1 ACCEPTED SOLUTION

Accepted Solutions
happyume
Solution Sage
Solution Sage

replace(variables('original email'),'@','_')

 

concat(outputs('Compose'),'#EXT#contoso.onmicrosoft.com')

 

 

happyume_0-1628878549014.png

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

View solution in original post

4 REPLIES 4
happyume
Solution Sage
Solution Sage

You can use replace function/expression to change @ symbol in original email to _

so john@msn.com will become john_msn.com.

From here concatenate the rest of your static string using the Concat function/expression.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

 

 

hi @happyume ,

how exactly do I type the expression? I'm new to this. I tried this....

replace(mystringvariable, '@','-')

... and us.flow.microsoft.com said The expression is invalid.

What article would be a good starting point to learn how to use the expressions?

 

happyume
Solution Sage
Solution Sage

replace(variables('original email'),'@','_')

 

concat(outputs('Compose'),'#EXT#contoso.onmicrosoft.com')

 

 

happyume_0-1628878549014.png

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up

The most likely reason you got error is because Power Automate did not save your entire syntax. Try putting your cursor at the end of your expression and click update/save.

 

You can learn more from: https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference

 

happyume_1-1628878774400.png

 

 

If the content of this reply was useful, then please consider giving it Thumbs Up

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

MPA Licensing.jpg

Ask your licensing questions at the Power Automate AMA!

Join Priya Kodukula and the licensing team, super users and MVPs to find answers to your questions on Power Automate licensing.

Users online (1,843)