87
Views
6
Comments
Solved
Loop inside a loop
Question

Hello,


I'm trying to create a loop inide a loop. In the second loop i want to have the ID of the parent loop. I do not know how to get the proper iteration ID. 


I'm currently doing Answer.QuestionId = GetQuestionsByQuizId.List.Current.Question.Id.in my Nested Loop, Which grabs the id of the first entity instead of changing to the next ID every loop. How do I get the next ID?

2023-12-16 19-57-03
Sanjay Kushwah
Solution

 Hi @Noah Kok,

you are asking about loop but added the image of lists🤔🤔

As per your attached image, you are using List inside parent list, you have added a filter in your child list aggregate Answer.QuestionId = GetQuestionsByQuizId.List.Current.Question.Id but you are not getting correct child records.

create a web block inside this web block take a input parameter QuestionId then now get all data filtered by this input parameter(using aggregate) and show in list in block, also refresh aggregate on Onparameterchange Handler.

Now you can use this web block in your parent list and pass the questionID of parent list source's aggregate.

Explanation: When parent list will load, each time web blok will be initiate and you have passed QuestionID into it it will show records based on parent list QuestionID.


Thanks,

Sanjay Kushwah

2025-01-23 05-58-39
Jamal Mohammed
Solution

Use a block inside and pass parent Id to the Block

2024-05-08 06-29-37
Prince Aadil Khan Panwar
Solution

hi Noah Kok,

take help from the OML. i am attaching below. for nested list you need to use webblock. so go through of it .

hope this helps

Thanks

Prince


NestedList.oml
2023-12-16 19-57-03
Sanjay Kushwah
Solution

 Hi @Noah Kok,

you are asking about loop but added the image of lists🤔🤔

As per your attached image, you are using List inside parent list, you have added a filter in your child list aggregate Answer.QuestionId = GetQuestionsByQuizId.List.Current.Question.Id but you are not getting correct child records.

create a web block inside this web block take a input parameter QuestionId then now get all data filtered by this input parameter(using aggregate) and show in list in block, also refresh aggregate on Onparameterchange Handler.

Now you can use this web block in your parent list and pass the questionID of parent list source's aggregate.

Explanation: When parent list will load, each time web blok will be initiate and you have passed QuestionID into it it will show records based on parent list QuestionID.


Thanks,

Sanjay Kushwah

2025-01-23 05-58-39
Jamal Mohammed
Solution

Use a block inside and pass parent Id to the Block

2024-05-08 06-29-37
Prince Aadil Khan Panwar
Solution

hi Noah Kok,

take help from the OML. i am attaching below. for nested list you need to use webblock. so go through of it .

hope this helps

Thanks

Prince


NestedList.oml
UserImage.jpg
Noah Kok

Thank you all for your inputs! I read into the examples you all provided about blocks and it resolved my issue!

2025-01-23 05-58-39
Jamal Mohammed

Great good to hear that

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