Hey all, I've just started using flow but trying to learn as much as I can by looking through the documentation. I'm trying to create a flow that will forward an email all users within a specific department (based on the subject of the email, and whether or not it contains the department)
Is there something in flow I can use to pull the username of each corresponding user, and then have their name added to the body? I was looking through the Dynamic Content tags and couldn't find anything. Something like below:
"Hey [FIRST.NAME],
Here is the report for your department. Thanks!"
This will be the first of many personalized emails I'd like to set up with flow, and thought being able to add the user name to the body would be a nice touch.
Hi @rykiff ,
I am not sure what Group you mentioned is specifically? Office 365 group or others? User info does not seem to contain this property.
Please provide more details so that we could provide proper workaround.
Best Regards,
Hey Barry, this is fantastic! The iteration finishes successfully now. I'm not sure if this is exactly related to departments, but is there anyway to also differentiate user membership by group? If I could take these results, and pair them with a condition that sends only if they are a member or director, my flow would be complete. Seriously though, this is awesome, thanks for all your help!
Hi @rykiff ,
You could use Filter array to filter out the members of the corresponding department before using Apply to each.
Alternatively, you could click on Apply to each-Settings to customize the degree of parallelism.
Image reference:
Best Regards,
Hey Scott, thanks for the reply. The IndexOf expression definitely sounds like it would be a good option -- I'm not too familiar with flow yet, but I'll be sure to use these as a good basis for some deep research this evening. I felt that the AzureAD connector would be the most useful for my use-case scenario, but unfortunately that functionality gives me a warning stating I need administrator approval, so I'll have to check with IT to see if there's anything I can do there.
Also Barry -- I really like your flow, the logic seems easy enough to follow, so I went ahead and set it up to test myself. I keep running into an issue where on the condition 'apply each' logic loop, it takes a bit of time (maybe around 30 seconds) and then timeouts after 100 iterations. My organization has about 700 active users -- is there an alternative way to search for users who match the department condition (as specified in the email subject)? One thing I should've mentioned in my OP is that users will also be members of one of two groups; either our 'Managers' group, or our 'Directors' group (totalling about 60 users total). Is it possible to make a condition that filters these users out first, and then compare the department to those 60 users instead of my entire organization? Thanks again for the replies, excited to get this flow going.
Hi @rykiff ,
Please refer to the following method to configure Flow.
Image reference:
Please take a try.
Best Regards,
Here is something that you can try:
I haven't had time to test the AzureAD Get Group members action but it should work for you.