Loop logic
Application Type

Hello Everyone,

I'm counting the number of rows in an integer variable using some round-off logic. After that, I want to insert some data into a list, but the problem I'm facing is that I need a loop to insert data one by one, but I have a number count, not any list. How can I achieve the solution for that type of problem? Can anyone please suggest one?



Hard to understand the question.

"Counting number of rows in an integer variable"
Do you mean this is a List variable with datatype Integer or do you mean that you are counting the number of characters in an integer variable?

Hi @Rakhi Chouhan,

Can you please explain a bit or share an Oml or screenshot of your query?

Could you be more clear about the problem, it's a bit hard to understand, thank you


If I understand correctly, then you can try like below. Creating loop using IF widget.  so you will have Count var(contains total no of rows count), then create local var in screen action (default will be 0), this loop will run as no of times as your total count. hope this helps.

Hey @Rakhi Chouhan ,

Please have a look on the below demo OML. You can understand the logic behind the loop .

Thanks & Regards,

Sudip Pal


Hi, @Rakhi Chouhan

Just use ad-hoc loop (Which is a loop that you can create using If condition) instead of for-each. 

Here's an example

Just don't forget to increment your count after each append, else you'll be stuck in an infinity loop.

Thank you, I hope this helps!

Hello @Puja Rani , @Sudip Pal ,and @saad siddiqui ,

Thank you very much for your suggestions. I got the solution by using JavaScript and Jason deserialization.



That is a great news. Can you please drop your solution in your post and mark it resolved?

Thanks & Regards,

Sudip Pal

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.