cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Razor
Level: Powered On

Adding a Switch on User's Domain

I have a simple Flow that has been working great.

 Screen Shot 2019-02-07 at 1.32.11 PM.png

I have a request to change the flow so an email is only sent when someone outside select domains create or modifiy a file. I imagine the flow would look something like this;

 

Screen Shot 2019-02-07 at 1.32.27 PM.png

 

I have no idea how to make this happen. Any suggestions on where to start?

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Adding a Switch on User's Domain

Hi @Razor

 

This is the approach I'd take for what you're trying to accomplish:

  1. Using the same trigger from your screenshot, I added a Data Operations - Compose action, which I renamed to User Domain. In this action, I created the expression below to extract the user's domain from the Modified By Email dynamic content.
    last(split(triggerBody()?['Editor']?['Email'],'@'))
    UserDomain-1.JPG

  2. Then I added a Condition to check against 2 specific domains, similar to your screenshot. You can always adjust this based on the number of domains. To have 2 rows in the Condition, click on Add row and then check the logic operator from And to Or. You can see it in the screenshot below. Once you have these actions configured, then you can add your logic to your Yes and No branches.
    UserDomain-2.JPG

I  hope this suggestions solve your issue or point you on the right direction.

 

Regards,

Fausto Capellan, Jr


Fausto Capellan, Jr


Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Proud to be a Flownaut!


View solution in original post

6 REPLIES 6
Super User
Super User

Re: Adding a Switch on User's Domain

Hi @Razor

 

Can you please post the screenshots again? They are not being displayed in your original post.

 

Thank you,

Fausto Capellan, Jr


Fausto Capellan, Jr


Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Proud to be a Flownaut!


Razor
Level: Powered On

Re: Adding a Switch on User's Domain

I think I fixed my original post...

Super User
Super User

Re: Adding a Switch on User's Domain

Hi @Razor

 

This is the approach I'd take for what you're trying to accomplish:

  1. Using the same trigger from your screenshot, I added a Data Operations - Compose action, which I renamed to User Domain. In this action, I created the expression below to extract the user's domain from the Modified By Email dynamic content.
    last(split(triggerBody()?['Editor']?['Email'],'@'))
    UserDomain-1.JPG

  2. Then I added a Condition to check against 2 specific domains, similar to your screenshot. You can always adjust this based on the number of domains. To have 2 rows in the Condition, click on Add row and then check the logic operator from And to Or. You can see it in the screenshot below. Once you have these actions configured, then you can add your logic to your Yes and No branches.
    UserDomain-2.JPG

I  hope this suggestions solve your issue or point you on the right direction.

 

Regards,

Fausto Capellan, Jr


Fausto Capellan, Jr


Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Proud to be a Flownaut!


View solution in original post

Razor
Level: Powered On

Re: Adding a Switch on User's Domain

@faustocapellanj That worked! Thank you!

 

I was close, but your data operations command was what I was missing.

 

I marked your solution as the correct one, but I do have a follow up question. I'm going to add it here, please forgive me if I'm breaking protocol.

 

I have a site that has several subsites underneath it. I have a copy of my initial flow looking over each subsite's document folder. Each subsite is tailored to an external user/customer where they place documents. From my understanding of Flow this was how it needed to be done. To make this change I would need to update enough Flows to where it could be done, but it would be a bit of a pain to do. My sites are growing quickly enough that in a few months it would be almost impossible to manually update all of them for a change like this.

 

Am I doing this the right way? Can I write one Flow that watches over each of the the subsite's document librarys? Or am I stuck updating each one?

Super User
Super User

Re: Adding a Switch on User's Domain

Hi @Razor

 

Glad the solution worked out for you. As for the other Flow and the subsites, what is this Flow doing exactly with the folders? I'm asking so I can have a better understanding and perhaps offer a better solution. Plus if you have screenshots, that would help a lot.

 

Regards,

Fausto Capellan, Jr


Fausto Capellan, Jr


Did I answer your question? Mark my post as a solution! Did my response help? Please give it a thumbs up!

Proud to be a Flownaut!


Razor
Level: Powered On

Re: Adding a Switch on User's Domain

Hopefully this will make it a little easier to understand.

 

My Flow is set to trigger when a document is either added or changed by anyone not meeting the criteria I set thanks to you. I currently have a Flow monitoring each document library because of the way I know how to do it each document library URL is unique. (I have it crossed out on my example but I hope you get the idea.)

 

In this example I have 4 uniqe flow's monitoring 4 unique document libraries. With your help I now have to update all 4. (Not a big deal here but in reality I have many more.)

Screen Shot 2019-02-07 at 5.15.21 PM.png

Is there a way to write a Flow to monitor all subsite document libraries? This way when there is a change to the Flow I don't have to edit 60 of them, I can edit just one.

 

Screen Shot 2019-02-07 at 5.28.34 PM.png

 

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 101 members 5,366 guests
Please welcome our newest community members: