cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lfinman
Advocate I
Advocate I

Lookups lost when secondary filter applied

Looking for insight on whether this is a bug or known limitation.

 

I have a canvas app, displaying information about CDS Accounts.  Data collected is filtered using a view, as in:

 

Collect(
    colAllAccounts,    
        Filter(
            Accounts,
            'Accounts (Views)'.'Customer and Partner List (Customer Account Management)'       
    )
);

 

The columns returned by the view include three lookup fields: 

Partner (an Account lookup)

Implementing Partner (an Account lookup)

Primary Contact (a Contact lookup)

 

All of the above works successfully.

 

If I add a secondary Filter on the Collect (or ClearCollect), those lookup fields all become blank.  There is no data at all in those fields, other field types (strings, option sets, etc) contain data but not Partner, Implementing Partner, Primary Contact:

 

 

Collect(
    colAllFilteredAccounts,
    Filter(
        Filter(
            Accounts,
            'Accounts (Views)'.'Customer and Partner List (Customer Account Management)'
        ),
        'Account Name' <> "Microsoft"
    )
);

 

 

Has anyone else experienced this behavior?  Any feedback on whether this is a bug or known limitation?  Took some digging for me to nail down why data suddenly disappeared from my App, but narrowed it down to this.

 

Thanks,

Lyn

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @lfinman ,

 

This seems to be a persistent issue that relationship can not be referenced properly when generating the collection.

The workaround is to reference the lookup related value during the creation of the collection to successfully activate the relationship, for example, add a new column to store the LookUp related value by AddColumns function.

Collect(
    colAllFilteredAccounts,
    AddColumns(
    Filter(
        Filter(
            Accounts,
            'Accounts (Views)'.'Customer and Partner List (Customer Account Management)'
        ),
        'Account Name' <> "Microsoft"
    ), "NewColumn1",Partner.Account,"NewColumn2",'Implementing Partner'.Account,"NewColumn3",'Primary Contact'.Contact)
);

Hope this helps.

Sik

View solution in original post

2 REPLIES 2
v-siky-msft
Community Support
Community Support

Hi @lfinman ,

 

This seems to be a persistent issue that relationship can not be referenced properly when generating the collection.

The workaround is to reference the lookup related value during the creation of the collection to successfully activate the relationship, for example, add a new column to store the LookUp related value by AddColumns function.

Collect(
    colAllFilteredAccounts,
    AddColumns(
    Filter(
        Filter(
            Accounts,
            'Accounts (Views)'.'Customer and Partner List (Customer Account Management)'
        ),
        'Account Name' <> "Microsoft"
    ), "NewColumn1",Partner.Account,"NewColumn2",'Implementing Partner'.Account,"NewColumn3",'Primary Contact'.Contact)
);

Hope this helps.

Sik

Thank you Sik!  That fixed my problem.  Appreciate your response.

Helpful resources

Announcements
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,380)