How to join two CDS data source via lookup GUID value to get the GUID value of the lookup value of parent record? (in short, grandparent record GUID)
E.g. I have 3 entities.
1. Assessment Section
2. Assessment Question
3. Assessment Details
Assessment Details has a lookup field for entity Assessment Question.
Assessment Question has a lookup field for entity Assessment Section.
What I want is the GUID value for "Assessment Section" lookup field on "Assessment Question" entity to be added to the collection together with "Assessment Details" data
I tried to AddColumn using the following formula but
- zzlocalassessmentsectionid (getting a lookup value of lookup record returns an empty data even though "zzTextField" returns the data though since it is a text field)
- zzlookupassessmentsectionid (lookup to the Assessment Question returns value for the other text fields but not the lookup field. If I set the same Lookup function to a label text value with hardcoded "Assessment Question" GUID, it is working fine)
*Screenshot attached*
ClearCollect(colTest,
AddColumns
(
'Assessment Details',
"zzTextField",
assessmentquestionid.'Question Text',
"zzlocalassessmentsectionid",
assessmentquestionid.'Assessment Section',
"zzlookupassessmentsectionid",
LookUp
(
'Assessment Questions',
'Assessment Question' = assessmentquestionid.'Assessment Question',
'Assessment Section'.'Assessment Section'
)
)
)