How to append results into a rule input (array)

Hello Everyone,

I am trying to append data into a nested cdt in the order i enter data in the tabs, but unable to do so. Currently i am saving the data like this

saveInto:{local!info,a!save(ri!userData.UserInfo.field1,append(ri!userData.UserInfo.field1,local!info))

I have a big multi section form and each section has multiple tabs. The section (form) i am working has 4 tabs and each tab has almost same fields. I have a rule input called users data which is of the type usersData cdt. usersData cdt has nested cdt's. My use case is - users should be able to enter data in multiple tabs in the form and after entering the data it should be appended into one of the nested cdt's of the rule input. The nested cdt is an array. I want the data from tabs to be saved in the order user enters them.

Ex -

Tab 1 - Fields A, B, C                                                                 rule input - usersData  and type is userData_cdt

Tab 2 - Fields D,E,F                                                                  the above rule input has nested cdt in it i.e. userInfor_cdt and this is an array

Tab 3 - Fields G,H,I

Actual - 

When a user enters data in tab2 then the rule input is updated as userData---->userInfo---->+[1]....{D,E,F,G,H,I}

when the user enters data in tab 3 then the rule input is updated as userData---->userInfo---->+[2]....{D,E,F,G,H,I}

Expected -

When a user enters data in tab2 then the rule input should be updated as userData---->userInfo---->+[1]....{D,E,F}

when the user enters data in tab 3 then the rule input should be updated as userData---->userInfo---->+[2]....{G,H,I}

Thank you

  Discussion posts and replies are publicly visible