Merging two different lists into a common list
Application Type
Traditional Web

Hi All,

I am getting 2 different lists of data from API (name : template list and LetterItem list), the fields of those lists are  different . I have to merge both the list and display in a table. I used ListAppendAll to merge but not working. I created a common list and tried to add those 2 lists into that common list still not working. How can I achieve that ? Please help. 

Hello Arpit Arora,

ListAppendAll requires the list structure of source and destination to be matched. 

If you have created a new list with common attributes, you have to map the source attributes with destination attributes.

 Kindly refer to below image as example:

Here product list and category list are 2 different lists with different structures.

Now to combine the data inside one list, I had manually mapped the data by looping inside the list and append the new value to the newly created list by "ListAppend" action.

Hi Arpit,

Is there any relationship between both these lists . If yes than you can merge based on the relationship If not why even you are merging both the lists?



Hi Arpit,

you cannot merge a list into another since the structures are different.

If one of the lists can fit on another by mapping the fields you can try a For Each in the second list and use a ListAppend for each record, mapping the fields of the second list into the first list.

If none structure can absorb the other list, I suggest you to create a new structure and a new list and make a ListAppend on both list record after a For Each.

Regards

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