cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lcaputo
Frequent Visitor

How to attach files to Notes using power automate flow

Hi all,

 

I think what I'm trying to accomplish is simple, but I'm stumped.

 

In a power automate flow, I'm converting a file to PDF format and now I want to add that file as an attachment to a new Note in Dataverse.

 

Here's what I've done so far:

 

First, I grab the file from a Note that already exists, where the file is in Word format (.docx). I get the file and convert it to PDF successfully using the "Convert Word Document to PDF" connector. 

 

However, in the next step, when I try add a new row using the file output of the previous step, the flow is failing and I'm receiving the following error message: "Invalid character in field 'documentbody': '', hexadecimal value 0x1B, is an invalid character."

 

 

add a new row connector.PNGadd a new row connector_error.PNG

 

Am I missing a step or are my inputs wrong?

 

Any help is appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @lcaputo :

I am afraid there is no action that can directly update the attachments in Note,if you need this function I suggest you post this ideal on the IDEAL forum.

In addition ,I have an alternative:

You could consider adding a file column and use "Upload a file or an image " action to Upload the file.

I've made a test for your reference:

1\My table

vbofengmsft_0-1636080426318.pngvbofengmsft_1-1636080444824.png

2\My Flow:

vbofengmsft_2-1636080799083.png

The Result:

vbofengmsft_3-1636080821391.png

Best Regards,

Bof

 

 

 

View solution in original post

5 REPLIES 5
v-bofeng-msft
Community Support
Community Support

Hi @lcaputo :

I am afraid there is no action that can directly update the attachments in Note,if you need this function I suggest you post this ideal on the IDEAL forum.

In addition ,I have an alternative:

You could consider adding a file column and use "Upload a file or an image " action to Upload the file.

I've made a test for your reference:

1\My table

vbofengmsft_0-1636080426318.pngvbofengmsft_1-1636080444824.png

2\My Flow:

vbofengmsft_2-1636080799083.png

The Result:

vbofengmsft_3-1636080821391.png

Best Regards,

Bof

 

 

 

bhatiavinay99
Regular Visitor

We were able to upload attachment files to Notes table of Dataverse by following these steps to add a new row to Notes table name:
1. Set IsDocument to True

 

2. Wrap file content with base64() function in an expression

e.g.  Document needs to be set to base64(outputs('Get_file_content_using_path')?['body']) where I am reading document from SharePoint document library in an previous action

 

3. Associate between Note and Entity table by populating the Regarding (EntityNameS) column with value in the format PublisherName_EntityPluralName(GUID)

Note: For #3, Start with PublisherName_ for your environment and use Entity Plural name ending in s
e.g. crf39_customercases(cdf5ef2e-988e-ec22-b400-0022480af153) for entity called customercase
Use Dataverse action Get Row By Id and check the value of the @OData.id or @OData.editLink in Output body if you are still having doubts about the format.

 

4. Set description to *web* to display on Portal

bharathik
Frequent Visitor

Hi How can we upload multiple files for a single note file from power automate. The above code works for only one attachment. Please let me know how to proceed on this.

I will simply use a loop, and for each file,  repeat the steps.

Thank you! This helped me out. 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Users online (4,124)