Loop in microflow to combine data from head and item

Hi all, background to the problem: I have a microflow to add taskItems to a taskHead. The taskItems are based on a genericTaskItems. I would like to calculate the taskItem_duration based on fields in taskHead and genericTaskItem. To that end, I have created the following microflow: 1: Create a new taskHead object 2: Show taskHead on a page. The user can edit the task head and add a name and a complexity factor 3: A retrieve list activity pulls all genericTaskItems from the database 4: A loop cycles through the list an for each genericTaskItem a new taskItem is added to the newly created taskHead. I would also like to calculate the duration for the taskItem. Basis is the attribute genericTaskItemduration and taskHeadcomplexityfactor. I execute this calcuation during the creation of new taskItems while I also add other fields. Everything works fine, except the calculation. I suspect, that the complexityFactor as added by the user is not available yet during the loop. During debugging, the page to add data to taskHead is shown after the execution of the loop, although it should run before. Any suggestions? Would be great!
1 answers


I think you can get this to work by doing the following:

  • Duplicate the microflow
  • Rename the duplicate to IVK_CreateNewProcessSteps
  • In the CreateNewProcessSteps microflow, delete the first 2 steps
  • In the CreateNewProcessSteps microflow, create a parameter of entity ProcessHead called NewPH
  • In the CreateNewPH microflow, remove everything but the first two actions
  • On the ProcessHead NewEdit page, remove the Save button and add a microflow button that calls IVK_CreateNewProcessSteps

Now you can call the CreateNewPH microflow, which will create a new object and display the new edit page. After the user has entered all data into that page, clicking your new microflow button will call the CreateNewProcessSteps that will create the steps you desire.

Hope that helps,