NOTE: Please see the post I made regarding this on May 2nd 2025. The Sharepoint location that I was trying to write the .png image to is actually a Teams Channel Document folder. I tried it with an actual Sharepoint site and it all works.
Why is teams so different, since the backend for Teams is SHAREPOINT. Any help would be appreciated as the site I need to post the image to is a Teams Site.
So this is a little bit complicated to explain, but i'll try... All of this is running in a Cloud Flow.
I have an excel workbook that ingests a csv file everyday, and then updates chart data on a "dashboard" page on the last worksheet. There is an Excel Office script that runs to produce this. This part runs perfectly when the whole process is on OneDrive or on Sharepoint ( Actually a Teams Site).
The flow then runs another Excel Office Script to get the dashboard page as an image and writes it to .PNG file in Onedrive, or ( if I could ever get it to work ) in a Sharepoint library. The issue I have is that both scripts run fine, but while the file written to Onedrive is a valid .png image file... using the same commands to write this file to Sharepoint creates a .png file that is NOT in the correct .png format.
I isolated the steps to reproduce the back end part of this flow to test with. I have the Excel Workbook in the Sharepoint library and can execute the "Run Script" command perfectly fine. The script will return a variable called "base64Img" which contains the image of the dashboard page from Excel.
I then have 2 - Create File actions after this.
The create file actions both use an Expression of " dataUriToBinary(outputs('Run_script')?['body/result/base64Img']) " where they are using the output of the Run Script step. Identically.
The first is to try to write the file to the Sharepoint directory.... the file gets created but is not in a readable .png format...
The second uses a OneDrive Create file action with the same expression for file content, and this one produces a perfectly formed and readable .png file.
Here is the flow...
I really need to get this whole process working in the Sharepoint environment, as this is something that many others in the IT Department might need to be able to work on, or mimic for other needs and I don't want it to be tied to my own OneDrive account.
I when looking at the "downloaded" input from the steps... the first part of the OneDrive step looks like this: ( just a top snippet of the data) ( This is the downloaded INPUT not the downloaded OUTPUT... they should be the same)
*************************************
{
"host": {
"apiId": "subscriptions/e9bc7b8d-bb95-4e7a-baf8-230462d93177/providers/Microsoft.Web/locations/westus/runtimes/msmanaged-na/apis/onedriveforbusiness",
"connectionReferenceName": "shared_onedriveforbusiness",
"operationId": "CreateFile"
},
"parameters": {
"folderPath": "/Documents/NetworkUptime/RawData",
"name": "NetWORKUptime.png",
"body": {
"$content-type": "image/png",
"$content": "iVBORw0KGgoAAAANSUhEUgAACLcAAAisCAYAAACwU5LlAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAP+lSURBVHhe7P1/6CXXeef75jKeE8HxYexzdbiCo4DA/kN3ri7kgGD8hxhywGAN+A9xxsYaYoxDjLEmwiSDCIqOuCbYg5DtHIFNRiLB42DjNFgEzVEiy7IS/6BjW7GOLZmOpaNudbekltSSuq3W75bVatWtz3c9Za1e/dSqWruq9q7a+/2CD1Lvvdf+Ubt2Pftb69lVvwEAAABgvioAAAAAg9nXawAAAAAAAAAAMDbbFw8AAABgAPt6DQAAAAAAAAAAxmb74gEAAAAMYF+vAQAAAAAAAADA2GxfPAAAAIAB7Os1AAAAAAAAAAAYm+2LBwAAADCAfb0GAAAAAAAAAABjs33xAAAAAAawr9cAAAAAAAAAAGBsti8eAAAAwAD29RoAAAAAAAAAAIzN9sUDAAAAGMC+XgMAAAAAAAAAgLHZvngAAAAAA9jXawAAAAAAAAAAMDbbFw8AAABgAPt6DQAAAAAAAAAAxmb74gEAAAAMYF+vAQAAAAAAAADA2GxfPAAAAIAB7Os1AAAAAAAAAAAYm+2LBwAAADCAfb0GAAAAAAAAAABjs33xAAAAAAawr9cAAAAAAAAAAGBsti8eAAAAwAD29RoAAAAAAAAAAIzN9sUDAAAAGMC+XgMAAAAAAAAAgLHZvngAAAAAA9jXawAAAAAAAAAAMDbbFw8AAABgAPt6DQAAAAAAAAAAxmb74gEAAAAMYF+vAQAAAAAAAADA2GxfPAAAAIAB7Os1AAAAAAAAAAAYm+2LX4Sbb75ZkwZu3v3ud1cnT560W/bn3Zeyf/9+uwUQfOADH3DXFV2+blo/veeilD6f3OdK122bBx98sLr88st//Rq17djG1zl3d911V3XDDTfsra96D+L1Tv/W5bpet0M31b+PfOQj5yzHa665ZqW6ODfb/Nq
*********************************************
While the downloaded input from the Sharepoint action looks like this: (again, only a snippet of the top) .... it almost looks like this is already in PNG format, but I have tried all sorts of different ways to account for this but cannot.
******************************************
{
"host": {
"apiId": "subscriptions/e9bc7b8d-bb95-4e7a-baf8-230462d93177/providers/Microsoft.Web/locations/westus/runtimes/msmanaged-na/apis/sharepointonline",
"connectionReferenceName": "shared_sharepointonline",
"operationId": "CreateFile"
},
"parameters": {
"dataset": "https://csgroup1.sharepoint.com/sites/DASafetyCommittee",
"folderPath": "/Shared Documents/General/NetworkUptime/RawData",
"name": "RobsNetworkUptimes.png",
"body": "�PNG\r\n\u001A\n\u0000\u0000\u0000\rIHDR\u0000\u0000\b�\u0000\u0000\b�
\b\u0006\u0000\u0000\u0000�S��\u0000\u0000\u0000\u0001sRGB\u0000��\u001C�\u0000\u0000\u0000\u0004gAMA\u0000\u0000��\u000B�a\u0005\u0000\u0000\u0000\tpHYs\u0000\u0000\u000E�\u0000\u0000\u000E�\u0001�o�d\u0000\u0000��IDATx^���%�y���2�\u0013��a�su������Cw�.�`��\u0018r�`\r�\u000Fq��\u001Ab�C��&�$�\b���&��\u001C�MF\"��`�4X\u0004�Q\"˲\u0012��c[��-����nu���Ԓ�����jխ�w=e�^�ԪZ��������\u000FR���Q�v=�[��U�\u0001\u0000\u0000\u0000`�*\u0000\u0000\u0000\u0000���k\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u000006�\u0017\u000F\u0000\u0000\u0000`\u0000�z\r\u0000\u0000\u0000\u0000\u0000\u0000\u0000\u0000�f�
************************************
I just don't get why the Sharepoint Create file looks at this so differently than the OneDrive action. Onedrive is actuall built on Sharepoint, so it makes no sense.
Any help would be greatly appreciated...