Iterate list inside another list

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi Shivangi,

You can just create a server action and iterate the second list inside that action.

Best Regards,
Jose

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?

Because in the image you show us, you seem to want ForEach on the same 2x list. If so, why in the first interaction you do not already do everything you need to do? Ai would not need 2 ForEach on the same list.

Bernardo Condé wrote:

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?


yes you can see the disabled element in the screenshot i want to connect it just after the createorupdate action for repair group , as my requirement is to map the parts/product to the recently created repair group.


Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?


yes you can see the disabled element in the screenshot i want to connect it just after the createorupdate action for repair group , as my requirement is to map the parts/product to the recently created repair group.


Because in the image you show us, you seem to want ForEach on the same 2x list. If so, why in the first interaction do not you do everything you need to do? Ai would not need 2 ForEach on the same list.
Right after your CreateOrUpdate, you continue the flow to the ProductId assign, without needing 2 ForEach.


Bernardo Condé wrote:

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?


yes you can see the disabled element in the screenshot i want to connect it just after the createorupdate action for repair group , as my requirement is to map the parts/product to the recently created repair group.


Because in the image you show us, you seem to want ForEach on the same 2x list. If so, why in the first interaction do not you do everything you need to do? Ai would not need 2 ForEach on the same list.
Right after your CreateOrUpdate, you continue the flow to the ProductId assign, without needing 2 ForEach.


i need 2 for each loop because there are multiple products associated with a repair group. 


Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?


yes you can see the disabled element in the screenshot i want to connect it just after the createorupdate action for repair group , as my requirement is to map the parts/product to the recently created repair group.


Because in the image you show us, you seem to want ForEach on the same 2x list. If so, why in the first interaction do not you do everything you need to do? Ai would not need 2 ForEach on the same list.
Right after your CreateOrUpdate, you continue the flow to the ProductId assign, without needing 2 ForEach.


i need 2 for each loop because there are multiple products associated with a repair group. 


Then place a for each within the other, for each item you go through, you will go through the whole list again and fill in your data. Not?


Bernardo Condé wrote:

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?


yes you can see the disabled element in the screenshot i want to connect it just after the createorupdate action for repair group , as my requirement is to map the parts/product to the recently created repair group.


Because in the image you show us, you seem to want ForEach on the same 2x list. If so, why in the first interaction do not you do everything you need to do? Ai would not need 2 ForEach on the same list.
Right after your CreateOrUpdate, you continue the flow to the ProductId assign, without needing 2 ForEach.


i need 2 for each loop because there are multiple products associated with a repair group. 


Then place a for each within the other, for each item you go through, you will go through the whole list again and fill in your data. Not?



Modified accordingly, but its giving me error "Detected a recursive iteration over the same list"

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Bernardo Condé wrote:

Shivangi Thakur wrote:

Hi,

i am moving data from entity  sis_repair_group_lib2 to sis_repair_group2 , the mapping is shown in above figure, while selecting multiple elements from repair_group_lib2 table i want all the selected element to be save in repair_group2 entity, this is happening but as you can see in the detail table both are mapped to product to when i am moving data i want the corresponding product mapped with repair_group_lib2 should be mapped to repair_group2.

Here is what i m doing to achieve this

 

first m moving data to repairgroup2 once its created i want to iterate another list to map the corresponding products with repairgrop2 as it is in the repairgrouplib2 ,how can i achieve this ??



Thanks 

Hi, do you need to give ForEach on the same list 2 times?


yes you can see the disabled element in the screenshot i want to connect it just after the createorupdate action for repair group , as my requirement is to map the parts/product to the recently created repair group.


Because in the image you show us, you seem to want ForEach on the same 2x list. If so, why in the first interaction do not you do everything you need to do? Ai would not need 2 ForEach on the same list.
Right after your CreateOrUpdate, you continue the flow to the ProductId assign, without needing 2 ForEach.


i need 2 for each loop because there are multiple products associated with a repair group. 


Then place a for each within the other, for each item you go through, you will go through the whole list again and fill in your data. Not?



Modified accordingly, but its giving me error "Detected a recursive iteration over the same list"

That's what I said, it would prevent a ForEach on the same list 2x in a row. What you can try to do is to give a ListAppendAll in it, just after ListFilter2, and in a ForEach you go through the ListFilter list and in the other you scroll through the ListAppendAll list. For this you create a local variable, with the type of the same list you are already traversing. It might help you.


Edit: However, I just did the same test as you, and it worked, did not return me error, see:

People, could you please stop quoting each other every time? It makes for a very long topic that's difficult to read. Thanks.

Why are people down voting Killian's comment on quoting? I for one totally agree it makes topics unreadable. Actually I rather have the quote function be removed.

Hi, Bernardo and Shivang,

I would like to ask you to avoid quoting the entire comment when answering.

I'll explain why this is a bad practice in a forum. 

Of course, because of what Kilian already mentioned in the first place. It was hard for me to even find out who was answering here, I will not even try to read the answers. So, you are basically sending away potential contributors to the topic.

Second. It is basically an absolutely useless action, because "quoting" is meant to give context to a specific part of a comment, to help those who read understanding the answer through context.

So... Please, don't do that.

On another topic, I would like to say that downvoting Kilian and Daniël comments is a very childish thing to do, basically something in the line a seven year old would do as a revenge for being criticized. I don't know who make the downvotes, but this is TOTALLY unfair and without useful purpose.

We are all adults here, let's behave like adults, shall we?

Cheers.

I don't know if you already find the answer to this problem but you could

Get all  SIS_REPAIR_GROUP_LIB_DETAIL2 inside the first foreach with filter  Repair_Group_Id (foreach current);

Then do a for each of SIS_REPAIR_GROUP_LIB_DETAIL2.list inside the first foreach and map this values to SIS_REPAIR_GROUP_DETAIL2;

With that you would have the ProductId from SIS_REPAIR_GROUP_LIB_DETAIL2 and Repair_Group_Id from CreateOrUpdate Action.


Sorry if i did not understand your problem correctly.

Cheers