0

I need to join 3 Lists, but i have no access to the on-prem sharepoint to test my idea right now. So I hope anybody can tell me, if it's possible.

I have Lists A, B and C. LookupFields are connected from List C -> B -> A. (one LookupField each)

I want to start the join from List B. I get list B with web.get_lists().getByTitle("B"); via JavaScript.

So starting the join from list B, would something like this be possible?

<Joins>
 <Join Type='INNER' ListAlias='A_'>
  <Eq>
   <FieldRef Name='LookupField_in_B' RefType='ID'/>
   <FieldRef List='A_' Name='ID'/>
  </Eq>
 </Join>

 <Join Type='INNER' ListAlias='C_'>
  <Eq>
   <FieldRef List='C' Name='LookupField_from_C_to_B' RefType='ID'/>
   <FieldRef List='C_' Name='ID'/>
  </Eq>
 </Join>
</Joins>

1 Answer 1

0

Pretty much, although you would want to left outer join your tables.

Have a look at this MSDN article for reference.

2
  • I tried it, but it does not work. The join is only working when joining the lists from C -> B -> A. Not C <- B -> A.
    – Beh
    Commented Feb 1, 2016 at 15:48
  • Yes sorry, you would always want your primary table on the far left. Commented Feb 1, 2016 at 15:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.