# Inputs for LoopWhile : to have dynamic x data to loop node actions

**URL:** <https://forum.dynamobim.com/t/inputs-for-loopwhile-to-have-dynamic-x-data-to-loop-node-actions/6590>\
**Category:** Revit\
**Tags:** archi-lab, loop, schedule\
**Created:** [October 6, 2016, 5:23pm UTC](https://forum.dynamobim.com/t/inputs-for-loopwhile-to-have-dynamic-x-data-to-loop-node-actions/6590 "2016-10-06T17:23:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![m.yasemin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/m.yasemin/32/14951_2.png) [@m.yasemin](https://forum.dynamobim.com/u/m.yasemin)\
**Post date:** [October 6, 2016, 5:23pm UTC](https://forum.dynamobim.com/t/inputs-for-loopwhile-to-have-dynamic-x-data-to-loop-node-actions/6590/1 "2016-10-06T17:23:05Z")

</div>

Hey all,

I’m trying to figure out the inputs for the LoopWhile node. I think the node you want looped goes into _init_ but when it comes to creating the functions for the other two inputs _continueWhile_ and _loopBody_ I am not so sure

My aim: is to produce multiple Schedules from a list that’s been List.Chop’ed according to per-Schedule.

I have one KeySchedule node and the inputs include : ViewSchedule and Data.

**My first loop** will be the input to the ViewSchedule.  
This is based on the fact that the schedules to write to won’t exist so first I will have a process to use one existing schedule, that is duplicated x times and then looped to feed the ViewSchedule input for KeySchedule.

**The second loop** will be the input for the Data, I already have all the data organised into sublist structure, so using List.GetItemAtIndex I need the Index number to go from 0…x (and each index will be the data for another schedule)

[Click here to go to my other posted Topic on why my View Duplication is not working](https://forum.dynamobim.com/t/multiply-schedules-with-view-duplicate-nodes/6574)

**On this Topic please focus on what inputs go into:**  
-continueWhile  
-loopBody

Below is a screenshot to illustrate my idea , please ask me questions if its not clear what I’m trying to get out.

In screenshot below, I have attached the _LoopWhile_ to the _index_ input for _List.GetItemAtIndex_ as this is the integer that I want changing. Is this location in the sequence for _LoopWhile_ correct?

For _continueWhile_ = the value is greater than 1, so once it reaches 1 it should go onto the next integer  
//// _should it be less than or equal to 1?_ 🤔  
For _loopBody_ = so once it goes onto the next integer it will +1

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/1/1362a56cfdb2fc1018f4ea15beef740c1cd6c567.PNG)

---

<div class="post-metadata">

**Author:** ![m.yasemin](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.dynamobim.com/m.yasemin/32/14951_2.png) [@m.yasemin](https://forum.dynamobim.com/u/m.yasemin)\
**Post date:** [October 12, 2016, 4:12pm UTC](https://forum.dynamobim.com/t/inputs-for-loopwhile-to-have-dynamic-x-data-to-loop-node-actions/6590/2 "2016-10-12T16:12:31Z")

</div>

Ok so solution:

LoopWhile in _english_ is :

init = beginning index  
continueWhile = process function until you reach  
loopBody = funtion preformed on _init_

LoopWhile in example below:

init = 0  
continueWhile = less than (_list count and -1_)  
loopBody = + 1

So keep adding 1 to 0 until it reaches the length of my list (-1) _since I was ending up with 1 too many_

 ![](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/2X/b/b0f7e47354481f325566a1632599b58a2701e6ae.PNG)

---

<div class="post-metadata">

**Author:** ![simonrbjerre](https://avatars.discourse-cdn.com/v4/letter/s/82dd89/32.png) [@simonrbjerre](https://forum.dynamobim.com/u/simonrbjerre)\
**Post date:** [May 9, 2019, 11:59am UTC](https://forum.dynamobim.com/t/inputs-for-loopwhile-to-have-dynamic-x-data-to-loop-node-actions/6590/3 "2019-05-09T11:59:53Z")

</div>

Hi @m.yasemin,

I’ve tried your solution, but if i export the results into excel i only get the first and last result.  
Do you know how to get the results in between??

Thanks in advance.
