cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted

Building a joined collection from Flow Approval entities

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

2 REPLIES 2
mike528
Level: Powered On

Re: Building a joined collection from Flow Approval entities

Tomasz,

 

Have you tried creating the data with the columns you need as a view in CDS and then simply loading your collection with that view within PowerApps?

 

Thanks, Michael

Re: Building a joined collection from Flow Approval entities

Hi Mike!

That indeed sounds like a good idea, however I cannot create a view in "Approval Requests" entity. Maybe that is possible just for custom?

 

Can you?

 

Regards,

Tomasz

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Users online (9,005)