cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

How to use query against Salesforce Object

Is there any way to query against the Salesforce data directly.

Gone thru the documentation- 

https://docs.microsoft.com/en-us/power-query/connectors/salesforceobjects

Where it is quoted - 

Known issues and limitations

  • There is a limit on the number of fields a query to Salesforce can contain. The limit varies depending on the type of the columns, the number of computed columns, and so on. When you receive an error Query is either selecting too many fields or the filter conditions are too complicated it means that your query exceeds the limit. To avoid this, use the Select Query advanced option and specify fields that you really need.

 

I coudn't find the advanced option, please help.

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

Using the built-in salesforce connector, it is only possible to query data after importing the whole table in Power BI Desktop. There is a similar idea about adding salesforce query in Power BI , please vote it up.

 

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

 

Best Regards,

Dedmon Dai

View solution in original post

5 REPLIES 5
atoews
New Member

Hi All - I have encountered this issue for several years due to our usage of several extensive managed packages that push the query over the PowerBI URI character length.  The MS Documentation Known Issues & Limitation does a good job describing the problem, but as noted not so great providing detail on how to use the Select Query Advanced Option.  Fortunately it's not hard at all using Advanced Editor if you can find the right syntax.  Below is an example of a boilerplate query of the Account object (per Power Query Editor Advanced Editor) which against my org returns the dreaded URI length error:

 

atoews_2-1668438586265.png

 

As you can see it is attempting to pull the entire Account object inclusive of all fields before getting to the ability to limit the selected fields.  To get around this just reference the Advanced Editor syntax for a smaller object where you CAN get to the Select Columns interface, then copy/paste that code into your Account query editor and tweek the details as needed to make it fit.  Example shown below, it's not exactly a SOQL query syntax but you get the pattern, just string together the API names of all the fields you want to pull down and you're good to go!

 

atoews_3-1668438808277.png

 

 

DoryO
Regular Visitor

No one has explained why Microsoft documentation for the Salesforce connector mentions using "Select Query advanced option" to limit columns. Is this a documentation error? Is this an OBDC feature not applicable to Salesforce connectors?

 

The Salesforce REST APIs allow for the parameters we need but Microsoft's connectors don't take advantage of that. So I see no way to limit rows or columns. It is too easy to exceed 2k row limit and even column limits in the initial "Get" before we can "transform". 

 

amitchandak
Super User
Super User

@Anonymous , Check are you getting advance option under connection

AdvanceProperty.png



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Anonymous
Not applicable

Hey @Amit, thanks for your reply. 

I am aware of this method, I would need to download the salesforce driver. 

 

I was looking for if I could query using the Salesforce Object connector.

Hi @Anonymous ,

 

Using the built-in salesforce connector, it is only possible to query data after importing the whole table in Power BI Desktop. There is a similar idea about adding salesforce query in Power BI , please vote it up.

 

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

 

Best Regards,

Dedmon Dai

Helpful resources

Announcements
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors