Forum Discussion
Need Help - Salesforce Object DataSource.Error
- 5 years ago
Hi akhatri ,
You can use Table.Removecolumns() to remove the filtered columns from the source table to get the retain columns:
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("VdFdDsQgCATgu/S5SWXwr2dpev9rbEGdxRcStvLJuM9ziFxyISEd5yG4pHyN3NZ0K/oVZCv2m/qpxK/peE8nEIlKwkuxIlaqOdbC2zzKJDQSbRFovJHiOOVL2RbQReRIdBKyNh93ww40boEtSInEzSDCwcyZutlfO4kaCKRF6D9DX7n8TT2Di+BbtEgIgxRem+kQk+lMokcC2z/iQaBcoFGUbYs7EsotEtMICaXTxutOQlI0MtcAJ2WNj2AtlPf9AQ==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t, Column3 = _t, Column4 = _t, Column5 = _t, Column6 = _t, Column7 = _t, Column8 = _t, Column9 = _t, Column10 = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type date}, {"Column2", type date}, {"Column3", Int64.Type}, {"Column4", Int64.Type}, {"Column5", Int64.Type}, {"Column6", Int64.Type}, {"Column7", Int64.Type}, {"Column8", Int64.Type}, {"Column9", Int64.Type}, {"Column10", Int64.Type}}), #"Removed Other Columns" = Table.SelectColumns(#"Changed Type",{"Column1", "Column3", "Column4", "Column5", "Column6"}), #"Remain columns" = Table.RemoveColumns(#"Changed Type",{"Column1", "Column3", "Column4", "Column5", "Column6"}) in #"Remain columns"#"Removed Other Columns" will return the filtered table and #"Remain columns" will return the retained table.
Best Regards,
Community Support Team _ Yingjie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi akhatri
For anyone hitting this thread with the same 414 URI Too Long error - worth knowing that Power Query's column-pruning steps (Table.SelectColumns, Table.RemoveColumns) only help if they fold back into the SOQL sent to Salesforce. Whether they do depends on where they sit in the chain and on the connector version, so the accepted solution can work in some cases but not always.
The most reliable native fix is the Salesforce Objects connector's Select Query (advanced) option when first connecting - there you supply a custom SOQL like SELECT Id, Name, AccountNumber FROM Account listing only the fields you need. Since SOQL is supplied directly, the query stays short and 414 doesn't come up, regardless of folding behavior.
As a workaround if hand-writing SOQL isn't ideal, Metrica Power BI Connector for Salesforce on AppExchange lets you pick fields visually through a UI inside Salesforce - same effect (short query, no 414), without needing to write the SOQL yourself.
Free 30-day trial if you'd like to test it. Setup guides at https://metricasoftware.com/, demo available on request.
Cheers,
Metrica Team.