Good morning, <Note in writing this, I have actually Solved the issue – read on!>
I am using Power automate (flow) to integrate between BUZ and ServiceM8. All is going extremely well thank you apart from……
I have created workorders and each workorder is derived from data in an excel file (.xlsm). I would like to add the excel file as an attachment. Manually it works perfectly so i am happy with the basic concepts.
Looking at the howto and the documentation, I have completed Step1 (Create Work order), Step2 (Create attachment) and am having difficulty with step 3 (upload attachment data)
I am having two main issue being;
- I don’t understand enough of curl to translate curlopt to the http request I am using.
- My data file is in sharepoint - however for what it is worth, I have a base64 string with the content.
My request looks like;
And this actually works - but it creates a file (when I extract the attachment that looks like….
{“filepath”:"UEsDBBQA
so obviously it appears that the entire body is used as the file content.
If I take away the json and just put $content as the body, I receive the following error. (Actually I don’t receive an error - and the attachment is created - but it has saved the data as the base64 string rather that the actual binary data.
OK - now I have done some updates and now the issue is solved - however it may be beneficial for others to see the solution.
Note this is power automate, macro enabled excel file stored in sharepoint example.
-
When I get the file content using path sharepoint connector I get the content-type of application/vnd.ms-excel.sheet.macroEnabled.12
-
In the HTML Post operation, I use this string as the content-type
-
The accept header is still application/json
-
The body of the request is; body(‘Get_file_Content_using_Path’) - ie the complete body returned from the sharepoint action get file content using path which looks like;
-
{
“$content-type”: “application/vnd.ms-excel.sheet.macroEnabled.12”,
“$content”: "UEsDBBQA…………………………….”}
the only remaining issue(s) I have are;
- Just clicking on the link in service m8 (On a PC web interface) does not allow me to view the file - it recomends appsheet or google sheets - I would prefer to open with excel
- If I right click on the link, it downloads the file to downloads with a weird name such as dbo_0059afd6-96a9-494a-b665-23d593c72bcb.xlsm. This also happens when I upload a file via the web interface (drag and drop).
- The IOS App opens the file with no issues.
So in essence, my real question now that I have answered the original issue (Uploading) is can I extend serviceM8 so that when I click on a document it actually opens that document directly (In web view).
All the best
Stan
