
Hi, I want to bind SharePoint lists and create a collection from SharePoint Lists columns. I have 4 lists
List A
| A_ID | D_ID | A_DueDate | A_Status |
| 1 | 1 | 03-03-2021 | New |
| 2 | 2 | 03-15-2021 | Approved |
List B
| B_ID | B_Name |
1 | Alex |
| 2 | Tony |
List C
| C_ID | C_Country | C_PostCode |
| 1 | USA | 12345 |
| 2 | UK | 23456 |
List D
| D_ID | B_ID | C_ID | D_Value |
| 1 | 1 | 1 | 125 |
| 2 | 2 | 2 | 256 |
The New Collection that I want to create will look like-
| A_ID | A_DueDate | B_Name & C_Country | C_PostCode | D_Value | A_Status |
| 1 | 03-03-2021 | Alex, USA | 12345 | 125 | New |
| 2 | 03-15-2021 | Tony, UK | 23456 | 256 | Approved |
Is it possible to create a collection to fetch data from different SharePoint List?
with my information I mentioned all queries If you want to know more please reply.
Thanks
Consider the following formula for what you need:
With({_listA: ListA, //Possibly you want to filter your List here
_listB: ListB, // same as above
_listC: ListC // same as above
_listD: ListD // same as above
},
ForAll(_listA As _listAitem,
With({_listBitem: LookUp(_listB, B_ID = _listAitem.A_ID),
_listCitem: LookUp(_listC, C_ID = _listAitem.A_ID),
_listDitem: LookUp(_listD, D_ID = _listAitem.A_ID)},
{A_ID: _listAitem.A_ID,
A_DueDate: _listAitem.A_DueDate,
'B_Name C_Country' : _listBitem.B_Name & ", " & _listCitem.C_Country,
C_PostCode : _listCitem.C_PostCode,
D_Value: _listDitem.D_Value,
A_Status: _listAitem.A_Status
}
)
)
This will return a table based on your information and requirement.
I hope this is helpful for you.