I have had some issues Creating a file in Sharepoint from items attached in Notes for Dynamics 365.
1) The Dynamics "when record created" triggers anywhere up to 7 hours delayed. (this is a sidenote, but is making testing hard).
2) Data stores in Dynamics is in Base64.
My orignial Process was:
1. Dynamics 365 - When Record Created
2. Check if note has Document
3. Sharepoint - Create File
This would correctly create the file in sharepoint, but i could not preview the jpg.
when i downloaded the jpg i noticed a size difference,
i opened the jpg in notepad to find a string of the Base64 data.
I found a workaround using logic apps functions "@{base64toBinary()}", i put this in a compose operation before the Sharepoint -Create File and used the output as the Document Body.
However i could still not preivew the file.
I downloaded again and opened again in a text editor, to find it WAS in binary but that the conversion was off.
Opening in a hex editor you can see some discrepancies between the two, but the meta data seems mostly there.
Is there a correct Flow process to get datatypes to be the same? when dealing with files is there a correct method of converting them? is this just incomplete flow controls not handing data times correctly? is it a bug, incomplete or am i just not doing it correctly?
Hello, please can you be so nice to post the flow you used
Yes ... please post your whole flow? I've been trying to figure out how to get files from Dynamics as well.
I'd like to use them for passing into a different connector but can't even figure out how to get them out.
Yours is working?
I just gave your solution a shot and I'm still unable to get usable files. Can you post your whole flow?
Thank you!
mstr
Hi, Firstly thanks for the top idea, as I have a requirement to do this.
If I add the base64ToBinary
to the Create File Area, it seems to work correctly and I can open the files.
thanks Justin
Hello,
has there been any updates on transfering files from CRM to sharepoint?
Hi Daivd_E,
Thanks for your detailed information.
I have reported this issue on my side, I will back to you once I got any response about this issue.
Thanks for your patience and understanding.
Best regards,
Mabel Mao
Hello,
sorry it took me some time to work out the nuance of inserting an image into the forum.
I start with getting notes when one is created. - from CRM trail can take up to 4 hours to trigger? - but works.
then filter on when it relates to a work order. - works as expected
Then i filter where isDocument is true. - using advance because "true" does not equal true.
Then Currently i attemp to convert from base64 to binary, but inserting into a compose field the value: "@{base64toBinary(triggerBody()?['documentbody'])}"
once saved this for some reason hides the code but still preforms the desired action.
then i try inserting into Sharepoint.
From the outputs you can see the filename and type are being identified correctly.
and there is no errors.
Trying to open it in sharepoint returns:
This is the sample output from the saved file being opened with notepad when NO Base64toBinary convertion happened:
as you can see it just populated the file with a base64 string.
once i added the base64 to binary convertion in the compose task i get these different files:
correct on the left, incorrect on the right.
as you can see its close, and with a Hex editor its actually very simular, however i am not sure where it goes wrong.
The out of the box solution does not hold a constistant type for files, and i feel flow should take care to tranform data to one type when dealing with it internally and converting where required on the save and retierve connectors.
Hi Daivd_E,
How did you configure the condition “check if note has document”?
Could you try to add File Type after the File name to see if it works? E.g. “.jpg”.
Best regards,
Mabel Mao