web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : 4pzUKJQWTJoXTA1+u+flzt
Power Automate - Using Connectors
Unanswered

Execute a SOQL Query Limitation

Like (0) ShareShare
ReportReport
Posted on 25 May 2023 08:21:13 by

Hello,

 

I'm using the "Execute a SOQL Query" action to get records from Salesforce. When I look at the JSON that returns me, it says that has 5729 rows ("body": {"totalSize": 5729 ....}) but if I look at the JSON, it really only has 2000 records. Is there any kind of limitation with this action and any way to solve this? 

 

I know that for the "Get Records" action you can set in Settings --> Pagination to 10000 (for example) to remove the limitation, but I don't see this option available in "Execute a SOQL Query".

 

I'm using the related __r. fieldName so I think I can't use the "Get records" action because I can only specify fields for a single object.

 

Could you help me to get all records (not limited to 2000) from a salesforce query with related fields?

 

Thank you!

I have the same question (0)
  • lbendlin Profile Picture
    8,302 Super User 2025 Season 2 on 29 May 2023 at 01:02:45
    Re: Execute a SOQL Query Limitation

    The 2000 row limit is universal across the vast majority of the Salesforce API endpoints (also applies to SFDC reports connector in Power BI). The only exception I am aware of is the Salesforce Objects connector.

     

    This is a Salesforce limitation.

  • AlexLindberg Profile Picture
    87 on 07 Feb 2024 at 16:18:30
    Re: Execute a SOQL Query Limitation

    I have been running a Power Automate Flow using SOQL for the last several months.  The queries had been returning the expected number of rows (totalSize == number of rows returned).  Starting last week (01 Feb 2024) the queries returns only 250 rows.  TotalSize still references the correct number of rows. 

     

    Doing the same query with other tools (XL-Connect) all is as expected.

     

    Did Microsoft change the capacities without notice?  If so is there is there a resolution?

     

  • lbendlin Profile Picture
    8,302 Super User 2025 Season 2 on 07 Feb 2024 at 16:20:44
    Re: Execute a SOQL Query Limitation

    That would be very not nice of them.  

     

    If you have a Pro license you can open a Pro ticket at https://admin.powerplatform.microsoft.com/newsupportticket/powerbi
    Otherwise you can raise an issue at https://community.fabric.microsoft.com/t5/Issues/idb-p/Issues .

  • AlexLindberg Profile Picture
    87 on 12 Feb 2024 at 16:48:46
    Re: Execute a SOQL Query Limitation

    An update to this issue.  It seems that there is a limit with the SOQL widget and the size of the returned data. 

     

    Here is my original SOQL that is truncated to 250 records:

     

    SELECT
     Id ,
     Opportunity__c ,
     User__c ,
     Assigned_To__c ,
     AccountId ,
     CaseNumber ,
     LastModifiedDate ,
     Preferred_Platform__c ,
     Cloud_Design_Start_Date__c ,
     Cloud_Design_Completion_Date__c ,
     XXXX_Qualification_Completion_Date__c,
     Kickoff_Meeting_Date__c ,
     Status ,
     Comments__c ,
     XXX_Team_Notes__c ,
     Subject ,
     Description ,
     Request_Type_Internal__c ,
     CreatedDate
    FROM
     Case
    WHERE
     ( Record_Type_Name__c = 'Unique Record Type' )

     

    If I remove the 'Description' or any of the other Text fields, all 383 records are returned.

     

    Suggestions, Fixes, Any Guidance?

     

  • lbendlin Profile Picture
    8,302 Super User 2025 Season 2 on 12 Feb 2024 at 16:52:15
    Re: Execute a SOQL Query Limitation

    ok, shot in the dark. What is the overall size in bytes of the successful response? Your "Description" field can hold much (much) more data than the Base64 message size limit.

     

  • AlexLindberg Profile Picture
    87 on 12 Feb 2024 at 17:21:16
    Re: Execute a SOQL Query Limitation
    1. A successful (without the field Description) query is about 640465 bytes.

     

    1. A failed (truncated) query returns 452774 bytes.

     

    1. A query on only the “Description” adds 75,325 bytes, 

     

    Adding 1) & 3) together gives a total size of about 715,790.  The SOQL widget may have a buffer space limitation.  When it overflows, it tries to “fix it” to 250 records….

     

  • AlexLindberg Profile Picture
    87 on 12 Feb 2024 at 19:18:27
    Re: Execute a SOQL Query Limitation

    As another point of information - If I use the XL-Connect excel plugin, the SOQL query works as expected and returns all records and columns as expected.  It is something in the SOQL widget that is gating the response.

  • krzcho Profile Picture
    4 on 16 Feb 2024 at 11:08:55
    Re: Execute a SOQL Query Limitation

    Hi, what was the end result? Has the limitation been lifted? I am in the proces of flow creation and I am not sure whether to use SOQL or objects...

  • AlexLindberg Profile Picture
    87 on 16 Feb 2024 at 15:01:07
    Re: Execute a SOQL Query Limitation

    The issue still remains.  Something about returning 500k of data breaks something.

     

    I my case I have split the queries into several parts. That then requires the same number of processes to move the results, in my case, into SharePoint lists.  I have to do this because I can't find a way to merge two arrays with many fields and that have a single common key. If I could then the rest of the process would be unchanged.

  • lbendlin Profile Picture
    8,302 Super User 2025 Season 2 on 16 Feb 2024 at 15:04:58
    Re: Execute a SOQL Query Limitation
    merge or append?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Tom Macfarlan – Community Spotlight

We are honored to recognize Tom Macfarlan as our Community Spotlight for October…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 707 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 499 Moderator

#3
chiaraalina Profile Picture

chiaraalina 312

Last 30 days Overall leaderboard

Featured topics