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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Workflow loop For Each to create multiple records

(0) ShareShare
ReportReport
Posted on by 3,070

I'm trying to create a workflow that will allow me to create multiple records via a dynamic loop, but I'm running into a bit of a block with it.

Scenario

If an ACCOUNT has an N:N relationship with Record XYZ in custom entity SEGMENT with , THEN

FIND all SERVICES in SEGMENT XYZ 

CREATE an ACCOUNT SERVICE record for each SERVICE found

I have a workflow step to find the N:N relationship, and I can find all of the services in that Segment, but I cannot get it to loop through each

I know I could include multiple create steps, but I'd prefer not to have a static set of workflow steps, as it would necessitate modifying the workflow each time we add or remove a service

Any advice would be appreciated!

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Ryan,

    i replied yesterday to a similar question, please refer to this post:

    https://community.dynamics.com/crm/f/117/p/259098/727269#727269 

    The code you will find let you loop over a list of entities.

    Hope it helps.

    Please, let me know if you solve, otherwise feel free to ask more.

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna, ITALY

    Independent Contractor

    http://www.francescopicchi.com

  • Ryan Maclean Profile Picture
    3,070 on at

    Hi Francesco, thanks for replying.

    I can find a way to run a workflow on the results, using Aiden Kaskelas Workflow Elements Run Workflow on Query Results step  -kaskelasolutions.com/activity-run-workflow-on-query-results

    I'm struggling with dynamically passing through the Account name from which the workflow was triggered though.

    I should be clear, I'm not a coder, so creating custom workflow activities is a bit of a challenge!

  • Ryan Maclean Profile Picture
    3,070 on at

    Anyone else able to offer any potential advice on this?

  • Suggested answer
    Community Member Profile Picture
    on at

    Hi Ryan,

    unfortunately when you deal with collection workflow automation is a pain.

    I could suggest to take this opportunity to deep your experience over custom workflow.

    If you need an hand, we are here :-)

    If you found the answer helpful, please mark as Verified 

    Join my network on LinkedIn      Follow me on Twitter 

    Thank You & Best Regards

    Francesco Picchi

    Microsoft Dynamics CRM Consultant, Bologna+Milano, ITALY

    Independent Contractor

    http://www.francescopicchi.com

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…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans