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

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested answer

Manual power automate flow

(0) ShareShare
ReportReport
Posted on by 85

Hi

I wonder if someone could help please with a power automate flow. I would need to update a subgrid on all contacts based on the owner's department, we have a marketing interests grid (it's a custom entity) added to the contact form so users can add what sort of products/webinar etc the contact may be interested for our marketing department and I need to create a flow to update all existing contacts based on the owner's department eg if the owner's department is "service" then the marketing interest would be "product 1", if the department is "sales" then the interest would be "product 2". It's a 1:1 mapping, but they are not called the same and we have about 15 of them so it would be good not to add 15 separate condition branches. Both fields are text fields. I also would want to avoid creating a new marketing interest if that given one is already added to the contact.

So that's the challenge, I'm quite new to power automate and really struggling with it. Any help would be greatly appreciated. 

Thanks!

I have the same question (0)
  • Suggested answer
    Bipin D365 Profile Picture
    28,981 Moderator on at
    RE: Manual power automate flow

    Hi,

    So once you have list of contacts then apply foreach loop to loop through each contact

    Inside foreach loop

    Add get a row by Id - To fetch the contact owner department

    Table - Users/systemuser

    Row Id - contact owner from dynamic content

    Once you have Department value

    Add list rows to check if Marketing interest already exist with the contact owner

    Tables - marketing Interests

    Filter query - contact lookup eq Contact Id and Department eq Department

    Check if count == 0

    Add row action to create marketing Interests record

    You can check below post to write filter query for list rows to check if Marketing interest exist

    saralagerquist.com/.../

  • Teach Me Profile Picture
    85 on at
    RE: Manual power automate flow

    Hi,

    Sorry, I wasn't clear. :-) I pretty much only know how to do the first step, trigger a manual flow, list the contacts and then I'm really struggling with the next steps, how to reference to list Owners within a list of Departments and then create the Marketing Interest with the given value matching the Contact Owner's Department.

    Thanks! :-)

  • Suggested answer
    Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Manual power automate flow

    Hi Partner,

    I just need a flow for this one off exercise to go through on all existing contacts. 

    Two ways:

    1.Using 'when a record is selected' trigger:

    pastedimage1669023461138v1.png

    pastedimage1669023466525v2.png

    2.Manually trigger and List rows action:

    pastedimage1669023747166v3.png

  • Teach Me Profile Picture
    85 on at
    RE: Manual power automate flow

    Hi,

    Thank you for looking into this, please see my answers below:

    1.based on the owner's department

    Contact's owner? - Yes

    'department' is one text field on the 'User' entity? - Yes

    2.marketing interests grid (it's a custom entity) added to the contact form.

    'marketing interests' entity has N:1 relationship with contact entity? - 1 Contact can have multiple Marketing Interests, 1:N relationship has been created on Contact to Marketing Interests

    3. It's a 1:1 mapping - between Department and Markleting Interest

    One contact can only has one marketing interests? - No, 1 contact have multiple marketing interest, but 1 User's Department matches 1 marketing interest

    So basically I'd like to run the flow on all existing contacts, list them then list the Contact's Owners and based on the Owner's Department add a new Marketing Interest row if it's not already created. I managed to set up the flow that will now populate the marketing interest on new contacts creation, I just need a flow for this one off exercise to go through on all existing contacts. 

    Many thanks for your help! :-)

  • Leah Ju Profile Picture
    Microsoft Employee on at
    RE: Manual power automate flow

    Hi Partner,

    Can you help answer the following questions?

    1.based on the owner's department

    Contact's owner?

    'department' is one text field on the 'User' entity?

    2.marketing interests grid (it's a custom entity) added to the contact form.

    'marketing interests' entity has N:1 relationship with contact entity?

    3. It's a 1:1 mapping

    One contact can only has one marketing interests?

    If so, why not create 1:N relationship between 'marketing interests and contact entity? Then use one lookup field in the contact form.

    4.we have about 15 of them so it would be good not to add 15 separate condition branches. 

    If fifteen departments correspond to different marketing interests, you will have to create 15 conditional branches.

    However, there is a limit of 8 nested conditions in the flow, so you need to use Switch control.

    pastedimage1668999055848v1.png

    You can refer to the following link for more actions about using flows in dataverse:

    https://learn.microsoft.com/en-us/power-automate/dataverse/overview 

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 101 Super User 2025 Season 2

#2
Suresh Kulla Profile Picture

Suresh Kulla 69 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 58

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans
Liquid error: parsing "/globalsearch/?q=t+s+s+s++n+o+s+o+n+o+n+o+o+n+o+n+o+n+o+n+o+n+o+n+o+n+o+" - Nested quantifier +.