Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Vienna from September 15-18, 2025, for the ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM. Get registered

Reply
sharp1FL
Frequent Visitor

Lookup activity returns incorrect column/values from altered Fabric table

I use a lookup table to get orchestration data from a Fabric table. The table was altered to add a column. If I perform an insert into the table where the added column is not the last value in the insert statement, the lookup will fail.

 

In this example, the ORCHESTRATION table was altered to add the SRC_FOLDER column. Id = 41 was inserted with SRC_FOLDER as the final column, where Id in (54,55) were not.

 

Below is part of the the output from Lookup.  SRC_FOLDER should always be "dataEngDev".

{
"count": 39,
"value": [
{
"Id": 54,
"STAGE": "BRONZE",
"DOMAIN": "TEST",
"SRC_FOLDER": "Edw_TEST_OutreachCharges",
"SRC_MASK": "STG_TEST_OUTREACH_CHARGES",
"TGT_TABLE": "CSN",
"TGT_KEY": "1",
"ACTIVE": null,
"NOTEBOOK": "|",
"DELIMITER": "9/23/2024 2:47:35 PM",
"UPDT_DTM": null,
"COL_HEADERS": "dataEngDev"
},
{
"Id": 41,
"STAGE": "BRONZE",
"DOMAIN": "TEST",
"SRC_FOLDER": "dataEngDev",
"SRC_MASK": "Edw_TEST_Appointments_",
"TGT_TABLE": "STG_TEST_APPT",
"TGT_KEY": "CSN",
"ACTIVE": 1,
"NOTEBOOK": null,
"DELIMITER": "|",
"UPDT_DTM": "2024-08-22T14:59:35.490716Z",
"COL_HEADERS": null
},
{
"Id": 55,
"STAGE": "BRONZE",
"DOMAIN": "TEST",
"SRC_FOLDER": "Edw_TEST_Utilization",
"SRC_MASK": "STG_TEST_PRV_UTILIZATION",
"TGT_TABLE": "PROV_NAME",
"TGT_KEY": "1",
"ACTIVE": null,
"NOTEBOOK": ",",
"DELIMITER": "10/17/2024 12:59:14 PM",
"UPDT_DTM": null,
"COL_HEADERS": "dataEngDev"
}
]
}

 

If I perform a SELECT, the columns are populated appropriately.

 

sharp1FL_1-1729174914325.png

 

The work around is to ensure that SRC_FOLDER is the last column on the insert, but this should not be necessary.

 

Is this a known issue?

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sharp1FL 

 

Thank you very much for sharing! It looks like you've found a solution.

 

There is currently no record of this issue.

 

In SQL, the order of columns in an INSERT statement must match the order defined in the table schema unless you explicitly specify the column names.

 

If the new column is added and not included in the INSERT statement, it may default to NULL or another default value, which could lead to unexpected behavior in your lookup.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @sharp1FL 

 

Thank you very much for sharing! It looks like you've found a solution.

 

There is currently no record of this issue.

 

In SQL, the order of columns in an INSERT statement must match the order defined in the table schema unless you explicitly specify the column names.

 

If the new column is added and not included in the INSERT statement, it may default to NULL or another default value, which could lead to unexpected behavior in your lookup.

 

Regards,

Nono Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

The column names were populated in the INSERT statement. Can this be logged as a known issue?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

Check out the June 2025 Fabric update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.