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

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
Resolver II
Resolver II

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

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Kudoed Authors
Users online (48,702)