cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Sveygal
Frequent Visitor

Using SQL data sources, LOOKUP Join in Gallery is returning blank values!

Hey guys, 

 

I'm trying to have my gallery read from two SQL tables by establishing a LOOKUP in the Items property. My two data sources are already established in the data tab:

Sveygal_0-1635284594674.png

 

The item property in its entirety looks like this: 

 

 

Filter(
    AddColumns(
        SALESORD_LINES,
        "ORDERDATE",
        LookUp(
            SALESORD_HDR,
            SEQNO = 'SALESORD_LINES'[@HDR_SEQNO]
        )
    ),
    HDR_SEQNO > 0 && STOCKCODE <> Blank() && STOCKCODE <> " " && HDR_STATUS = 0
)

 

 

The problem I have is that this returns a completely blank gallery, despite no formula problems or delegation issues.

 

I tried troubleshooting:

  • Getting rid of the join and just using either SALESORD_HDR or SALESORD_LINES sources returns values as expected
  • Isolating the join statement by removing the filter does not help

I created this based of this example from this video from Krishna Vandanapu - MVP .  Granted, his example was referencing Sharepoint data sources, but the example should apply to SQL sources as well right? 

 

Any help would be greatly appreciated. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Sveygal ,

 

To prevent performance issue, when using SQL Server tables as the data source, you will only get data in the column that you just added. You may test this with a collection to check the result value of AddColumns:

ClearCollect(colTest, 
             AddColumns(
                 SALESORD_LINES,
                 "ORDERDATE",
                 LookUp(
                     SALESORD_HDR,
                     SEQNO = 'SALESORD_LINES'[@HDR_SEQNO]
                 )
             )
)

 

Please use ShowColumns function to add value to all the data columns you need.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @Sveygal ,

 

To prevent performance issue, when using SQL Server tables as the data source, you will only get data in the column that you just added. You may test this with a collection to check the result value of AddColumns:

ClearCollect(colTest, 
             AddColumns(
                 SALESORD_LINES,
                 "ORDERDATE",
                 LookUp(
                     SALESORD_HDR,
                     SEQNO = 'SALESORD_LINES'[@HDR_SEQNO]
                 )
             )
)

 

Please use ShowColumns function to add value to all the data columns you need.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

Sveygal
Frequent Visitor

This clears it up @v-jefferni , thank you very much. 

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 (2,457)