Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Can Xrm.Device.captureImage be used to upload images to SharePoint?

Posted on by 70

Hi all,

Hoping for a bit of advice - I've developed a JavaScript web resource to help our maintenance team easily identify & check company assets by scanning barcodes. They have asked me if there's any way they can easily upload images from within this web resource and store them against the records in Dynamics. We have already integrated SharePoint with Dynamics and use it for our document hosting, so I thought it should be doable. I found the captureImage function and was hoping that I'd be able to use the Javascript SharePoint API to upload the images from within the web resource itself, without having to open the record form and navigate to the SharePoint upload (even then it doesn't allow for capturing images in-dialog, only uploading already captured ones). Has anybody done this/is it relatively easy to do? I have read that trying to use the SharePoint API within Dynamics is tricky due to the cross-origin nature of the request, but would really love some pointers before I get stuck in and realise it can't be done! 

I would really appreciate any advice on this.

Thanks

Sam

  • samnunn92 Profile Picture
    samnunn92 70 on at
    RE: Can Xrm.Device.captureImage be used to upload images to SharePoint?

    Hi Miguel,

    Thanks so much for your response - it's encouraging to know that it can be done! I've seen similar on blogs that I would need to register the Dynamics web resource as an app within Azure for the authentication issues to be overcome so I think that is probably the way to go. Thank you for your Flow suggestion too, I hadn't considered that (very interesting triggering on note create) and with some additional entity checking I think this could be a viable solution. I think ideally it would be best for users if they could stay totally within the web resource (as they can technically already upload to SharePoint from Dynamics via the Document Upload tab, just with a lot of navigation), but I will certainly bear your Flow suggestion in mind.

    Thanks again

    Sam

  • Suggested answer
    miguelbeja Profile Picture
    miguelbeja on at
    RE: Can Xrm.Device.captureImage be used to upload images to SharePoint?

    Hi,

    I believe it can be done, I've had a colleague (when I was a consultant) that was pushing to Sharepoint the creation of documents and metadata from CRM to Sharepoint.

    I believe you will need to use an application created in Azure which will generate a clientid and client secret which then can be used for the trusted/cross authentication between Dynamics and Sharepoint.

    He had a Webresource from Dynamics that was opened by a button, then the users filled in the info and saved. It was pushing all the info to Sharepoint.

    It should be something on those lines, but I believe you will need to dig in and "breack rocks" will trying to do this.

    But have you checked also if Flows can do that for you?

    Basically Flow would trigger once the picture was saved to Dynamics and then pass it to Sharepoint

    Somthing like:

    pastedimage1572021857240v1.png

    Tests:

    pastedimage1572022122548v1.png

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans