<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Unable to export object using /api/2.0/workspace/export API in Data Engineering</title>
    <link>https://community.databricks.com/t5/data-engineering/unable-to-export-object-using-api-2-0-workspace-export-api/m-p/118587#M45660</link>
    <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/163809"&gt;@hims_2021&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This error indicates an encoding issue when trying to export an Excel file from Databricks to SharePoint via Power Automate. The specific error message about being "Unable to translate bytes [9A] at index 11" suggests that Power Automate is having trouble processing binary content that's being returned from the Databricks API.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Use Base64 Encoding for Binary Content&lt;/STRONG&gt;&lt;BR /&gt;The most reliable solution for transferring binary files through Power Automate is to use base64 encoding:&lt;BR /&gt;python# In your Databricks notebook&lt;BR /&gt;import base64&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Path to your Excel file&lt;BR /&gt;file_path = '/dbfs/path/to/your/test.xlsx'&lt;/P&gt;&lt;P&gt;# Read the file in binary mode&lt;BR /&gt;with open(file_path, 'rb') as f:&lt;BR /&gt;file_content = f.read()&lt;/P&gt;&lt;P&gt;# Encode file content as base64&lt;BR /&gt;base64_content = base64.b64encode(file_content).decode('utf-8')&lt;/P&gt;&lt;P&gt;# Return the base64 encoded content&lt;BR /&gt;dbutils.notebook.exit(base64_content)&lt;BR /&gt;Then in Power Automate:&lt;/P&gt;&lt;P&gt;Run the notebook that returns base64 content&lt;BR /&gt;Decode the base64 content&lt;BR /&gt;Save the decoded content to SharePoint&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. Modify Export API Usage&lt;/STRONG&gt;&lt;BR /&gt;The issue may be with how the API is handling the binary file. Try these adjustments:&lt;BR /&gt;Option A: Use different format parameter&lt;BR /&gt;&lt;A href="https://databrick-server/api/2.0/workspace/export?path=/filepath/test.xlsx&amp;amp;format=DBC&amp;amp;direct_download=true" target="_blank" rel="noopener"&gt;https://databrick-server/api/2.0/workspace/export?path=/filepath/test.xlsx&amp;amp;format=DBC&amp;amp;direct_download=true&lt;/A&gt;&lt;BR /&gt;Option B: Use the /api/2.0/dbfs/read endpoint instead&lt;BR /&gt;Since you're trying to export an Excel file, it might be better to use the DBFS API directly:&lt;BR /&gt;&lt;A href="https://databrick-server/api/2.0/dbfs/read?path=/dbfs/filepath/test.xlsx" target="_blank" rel="noopener"&gt;https://databrick-server/api/2.0/dbfs/read?path=/dbfs/filepath/test.xlsx&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 08 May 2025 21:01:04 GMT</pubDate>
    <dc:creator>lingareddy_Alva</dc:creator>
    <dc:date>2025-05-08T21:01:04Z</dc:date>
    <item>
      <title>Unable to export object using /api/2.0/workspace/export API</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-export-object-using-api-2-0-workspace-export-api/m-p/118547#M45654</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;&lt;P&gt;I was using&amp;nbsp;&lt;SPAN&gt;/api/2.0/workspace/export API in power automate workflow to export to excel from data brick to sharepoint. This functionality was working fine till yesterday. Today onwards it is throwing below error while calling the API&lt;BR /&gt;&lt;BR /&gt;Action 'HTTP_Request_to_get_data_from_databrick' failed: Http request failed as the content was not valid: 'Unable to translate bytes [9A] at index 11 from specified code page to Unicode.'.&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;API URL used:&amp;nbsp;&lt;SPAN&gt;https://databrick server&amp;nbsp;/api/2.0/workspace/export?path=/filepath/test.xlsx&amp;amp;format=SOURCE&amp;amp;direct_download=true&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Please let me know if any one any clue to correct this.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;#API&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 15:18:36 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-export-object-using-api-2-0-workspace-export-api/m-p/118547#M45654</guid>
      <dc:creator>hims_2021</dc:creator>
      <dc:date>2025-05-08T15:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to export object using /api/2.0/workspace/export API</title>
      <link>https://community.databricks.com/t5/data-engineering/unable-to-export-object-using-api-2-0-workspace-export-api/m-p/118587#M45660</link>
      <description>&lt;P&gt;&lt;a href="https://community.databricks.com/t5/user/viewprofilepage/user-id/163809"&gt;@hims_2021&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This error indicates an encoding issue when trying to export an Excel file from Databricks to SharePoint via Power Automate. The specific error message about being "Unable to translate bytes [9A] at index 11" suggests that Power Automate is having trouble processing binary content that's being returned from the Databricks API.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;1. Use Base64 Encoding for Binary Content&lt;/STRONG&gt;&lt;BR /&gt;The most reliable solution for transferring binary files through Power Automate is to use base64 encoding:&lt;BR /&gt;python# In your Databricks notebook&lt;BR /&gt;import base64&lt;BR /&gt;import os&lt;/P&gt;&lt;P&gt;# Path to your Excel file&lt;BR /&gt;file_path = '/dbfs/path/to/your/test.xlsx'&lt;/P&gt;&lt;P&gt;# Read the file in binary mode&lt;BR /&gt;with open(file_path, 'rb') as f:&lt;BR /&gt;file_content = f.read()&lt;/P&gt;&lt;P&gt;# Encode file content as base64&lt;BR /&gt;base64_content = base64.b64encode(file_content).decode('utf-8')&lt;/P&gt;&lt;P&gt;# Return the base64 encoded content&lt;BR /&gt;dbutils.notebook.exit(base64_content)&lt;BR /&gt;Then in Power Automate:&lt;/P&gt;&lt;P&gt;Run the notebook that returns base64 content&lt;BR /&gt;Decode the base64 content&lt;BR /&gt;Save the decoded content to SharePoint&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;2. Modify Export API Usage&lt;/STRONG&gt;&lt;BR /&gt;The issue may be with how the API is handling the binary file. Try these adjustments:&lt;BR /&gt;Option A: Use different format parameter&lt;BR /&gt;&lt;A href="https://databrick-server/api/2.0/workspace/export?path=/filepath/test.xlsx&amp;amp;format=DBC&amp;amp;direct_download=true" target="_blank" rel="noopener"&gt;https://databrick-server/api/2.0/workspace/export?path=/filepath/test.xlsx&amp;amp;format=DBC&amp;amp;direct_download=true&lt;/A&gt;&lt;BR /&gt;Option B: Use the /api/2.0/dbfs/read endpoint instead&lt;BR /&gt;Since you're trying to export an Excel file, it might be better to use the DBFS API directly:&lt;BR /&gt;&lt;A href="https://databrick-server/api/2.0/dbfs/read?path=/dbfs/filepath/test.xlsx" target="_blank" rel="noopener"&gt;https://databrick-server/api/2.0/dbfs/read?path=/dbfs/filepath/test.xlsx&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 May 2025 21:01:04 GMT</pubDate>
      <guid>https://community.databricks.com/t5/data-engineering/unable-to-export-object-using-api-2-0-workspace-export-api/m-p/118587#M45660</guid>
      <dc:creator>lingareddy_Alva</dc:creator>
      <dc:date>2025-05-08T21:01:04Z</dc:date>
    </item>
  </channel>
</rss>

