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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Pages / How to execute batch w...
Power Pages
Suggested Answer

How to execute batch webapi requests on power pages?

(1) ShareShare
ReportReport
Posted on by 25
Hello everyone,
according to information on this page Execute batch operations using the Web API (Microsoft Dataverse) - Power Apps | Microsoft Learn I tried to execute a batch request on power pages but I only get "406 (Not Acceptable)" error message. Could you please check if there is anything wrong with my code? Or how else can I execute batch requests?

The code to execute the api request:
 
fetch(`/api/data/v9.2/$batch`, {
        method: 'POST',
        headers: {
          'OData-MaxVersion': '4.0',
          'OData-Version': '4.0',
          'Content-Type': `multipart/mixed; boundary="batch_8a23z8"`,
          'Accept': 'application/json',
          'If-None-Match': 'null',
        },
        body: batchdata,
      })
        .then(response => response.json())
        .then(data => {
          console.log('Batch request success:', data);
        })
        .catch(error => {
          console.error('Batch request error:', error);
          // Log the detailed error response if available
            if (error.responseText) {
                console.error("Server response:", error.responseText);
            }
        });
 
The test value in "batchdata" variable (I tried to type it in as text but it causes error when I update post):
 
 
Thank you for your help in advance!
Categories:
I have the same question (1)
  • Suggested answer
    Jon Unzueta Profile Picture
    1,834 Super User 2026 Season 1 on at
     
    1. Skip $batch in Power Pages
    For multiple actions:
    • Run them one by one with fetch or safeAjax.
    • Use Power Automate for server-side batch processing.
    2. Use safeAjax
    Handles CSRF tokens automatically. Example:
    webapi.safeAjax({
      type: "POST",
      url: "/_api/accounts",
      contentType: "application/json",
      data: JSON.stringify({ name: "Sample Account" }),
      success: function (res, status, xhr) {
        console.log("entityID: " + xhr.getResponseHeader("entityid"));
      }
    });
    3. Power Automate For Batch Tasks
    Send a list of operations to a flow using Dataverse connectors to bypass portal Web API limits.
     
     
    This content may have been partially translated, structured, or generated with Copilot 🏷️ Tag me if you have any further questions or if the issue persists. ✅ Click "Accept as Solution" if my post helped resolve your issue—it helps others facing similar problems. ❤️ Give it a Like if you found the approach useful in any way.

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Pages

#1
Suriyanarayanan V Profile Picture

Suriyanarayanan V 45

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 14 Most Valuable Professional

#3
Fubar Profile Picture

Fubar 6 Super User 2026 Season 1

Last 30 days Overall leaderboard