cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wak80
Level: Powered On

Moving notes documents from Dynamics to Sharepoint folder

Hi, 

 

I'm trying to move attachments from Dynamics notes to Sharepoint folder with flow.

1.png

Unfortunetly there is an issue. There is no option to pick Document Body in File Content field from Dynamic Content in Create file action step. However there is such option in File Name field...

2.png

Thanks in advance for your help.

 

Marcin

12 REPLIES 12
Dual Super User
Dual Super User

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 

 

You might want to use the CDS connector to do this. Also, please see the blog post below to copy attachments from CDS to Sharepoint. 

https://powerusers.microsoft.com/t5/Microsoft-Flow-Community-Blog/How-to-copy-attachments-from-the-C...

 

Hope this Helps!

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Super User
Super User

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 ,

 

Please see this blog post

 

https://community.dynamics.com/365/b/dynamicscrmconsultant/posts/part-2-use-microsoft-flow-to-move-n...

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



wak80
Level: Powered On

Re: Moving notes documents from Dynamics to Sharepoint folder

Unfortunetly the blog posts do not answer my issue. Changing connector also does not change anything - documentbody value needed in base64tobinary function is not available to choose.

Super User
Super User

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 ,

 

Thanks for your reply.

 

Not sure what you meant by the chainging the connector.

 

Please see below. Click tab Expression. Start typing base64 as you can see the options available.

 

b.png

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



wak80
Level: Powered On

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @abm,

 

By changing connector I mean changing Dynamics 365 get items step to CDS get items step for fetching notes - it was suggested in @yashag2255 answer.

 

I know that to sucessfully move document from Dynamics note to SharePoint folder I should use base64tobinary function. The issue is thatdocument body value is not available to select on dynamic values list to pass as it should be passed as parameter to base64tobinary function. Values that are possible to select are shown on the second image in my original post.

Super User
Super User

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 ,

 

Thanks a lot for your reply and good explanation.

 

I did tried to setup a similar flow like yours and I managed to upload the document attachment sucessfully to SharePoint from CRM notes attachment.

 

Here is my flow step. Please note I am only showing the foreach loop only.

 

d.png

 

Yes agreed that it doesn't show the document content from the default list. The trick is start typing the property name under Dynamic content. It will show the relevant property.

 

If you have any questions please let me know.

 

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



Dual Super User
Dual Super User

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 

 

Please see the flow screenshot below:

bbs.PNG

 

You can achieve this using the Dynamics connector too. 

 

Note: Ensure that you use the condition to check if the note is an attachment or it will keep failing for creating the item in sharepoint. 

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Community Support Team
Community Support Team

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 ,

 

Please use the expression below to configure File content field.

If we only use Document to configure the File content field, files uploaded to SharePoint may not open properly.

Expression reference:

base64ToBinary(items('Apply_to_each')['documentbody'])

Image reference:

37.PNG

Hope it helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Super User
Super User

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 ,

 

Did any of these answers were helpful? 

 

Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up.

 

Thanks

 

 



Did I answer your question? Mark my post as a solution!

If you liked my response, please consider giving it a thumbs up


Proud to be a Flownaut!



wak80
Level: Powered On

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi, 

@abm @yashag2255 @v-bacao-msft  many thanks for your answers. 

1. I can use search for finding Document in dynamic content

2. Using expression designer I cannot use this field - for me it's a bug that should be fixed by Ms

3. I wrote expression that @v-bacao-msft suggested

4. I tested flow: flow ran susccesfully but despite using base64ToBinary function I cannot open the word file flowdefinition.pngFlow definitionflowlog.pngFlow logerror.pngError while opening Word file

 

 

Community Support Team
Community Support Team

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @wak80 ,

 

Regarding the inability to use some of the Dynamic content directly in the expression designer, this is the case, not all Dynamic content can be directly referenced.

If you cannot use the expected Dynamic content, you could directly get the expression corresponding to Dynamic content by Peek code, and then fill it in the expression designer.

 

For example, to obtain the expression corresponding to Document, you can first fill the Dynamic content in Compose, and then click peek code to get the expression.

34.PNG35.PNG

 

In addition, I did a test on my side, I can use base64ToBinary() function to get the contents of the file and format it.

Please check if Word file in Notes can be opened normally and is a valid file. You could also test with the new word file.

36.PNG

Word file stored to SharePoint Library:

37.PNG

Expression:

base64ToBinary(items('Apply_to_each')?['documentbody'])

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wak80
Level: Powered On

Re: Moving notes documents from Dynamics to Sharepoint folder

Hi @v-bacao-msft,

 

On my tenant it's not working. I raised ticket in MS support on Friday and this ticket was forwarded to product group. I will let you know what is the outcome.

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 275 members 6,070 guests
Please welcome our newest community members: