Reputation: 5
I am trying to use caml join queries when querying data from sharepoint through the webapi and Power Automate (HTTP send)?
Is it possible to retrieve fields from the parent list through projectedfields, I can join and return fields from the child list but not the parent. Have been playing with this for sometime but no joy. I am wondering if this only works at all on the web api. Below is a representation of my script: Nomination Detail is the child list with a lookup to the parent list (Nominations) using column 'Nomination'. I want to show the NominationDate from the parent list, so I created a projectedfield and added it to the viewfields. But it will only show fields from the child list. Any guidance greatly appreciated.
_api/web/lists/GetByTitle('Nomination Detail')/GetItems(query=@v1)?@v1=
{"ViewXml":"
<View>
<ViewFields>
<FieldRef Name='ID'/>
<FieldRef Name='YearOfService'/>
<FieldRef Name='NominationDate'/>
<FieldRef Name='Nomination'/>
</ViewFields>
<Joins>
<Join Type='INNER' ListAlias='Nominations'>
<Eq>
<FieldRef Name='Nomination' RefType='Id'/>
<FieldRef Name='ID' List='Nominations'/>
</Eq>
</Join>
</Joins>
<ProjectedFields>
<Field Name='NominationDate' Type='Lookup' List='Nominations' ShowField='NominationDate'/>
</ProjectedFields>
</View>
"}
Upvotes: 0
Views: 56