Hi all!
I have a problem I totally don't understand. I am trying to create a collection built from joining two entities in CDS: Approvals and Approval Requests. To do that I want to use column called: Approval Id Index.
When application starts I clearcollect both entities to ApprovalsList and ApprovalRequests collections.
Now I want to create a third one, that has all columns from ApprovalRequests + three columns from ApprovalsList: Title, Completed On and Status Reason. For that reason I created this expression:
ClearCollect(
AllTasks,
AddColumns(
ApprovalRequests,
"StatusReason",
LookUp(
ApprovalsList,
'Approval Id Index' = ApprovalRequests[@'Approval Id Index'],
'Status Reason'
),
"TaskTitle",
LookUp(
ApprovalsList,
'Approval Id Index' = ApprovalRequests[@'Approval Id Index'],
Title
),
"TaskCompletedOn",
LookUp(
ApprovalsList,
'Approval Id Index' = ApprovalRequests[@'Approval Id Index'],
'Completed On'
)
)
);
But although, when I output column Approval Id Index from ApprovalRequests I see that for each row the value is different, the JOIN gives me the same information from Approvals for every joined row.. So in each row in AllTasks collection I'm having the same Title, Status Reason and Completed On values. Why is that happening? What am I missing?
Any help appreciated.
Regards,
Tomasz