In this blog, we show you how to upload a camera photo from a Canvas App to Dynamics 365 as an attachment on a particular entity record.
In today’s blogpost, we’ll show you how to use Power Apps and Flow to send a photo from any mobile phone to an Account’s SharePoint Folder. Enjoy!
Depending on the type of business, it can be pretty common for field employees to need to take photos of the work they do. These photos are generally archived by the business as a record of work done and/or used in reports that go to customers showcasing the work done for them. Many businesses prefer SharePoint as a place for storing such photos. If you use Dynamics 365 for Customer Engagement, you can use the OOB SharePoint Integration to create unique folders in SharePoint using a concatenation of the name of the Account and the account’s Unique Identifier.
For example, in our test environment we’ve got an Account named Saratoga Boat works and the associated folder is named Saratoga Boat works_28D7AD371687E811A967000D3A109495.
Using PowerApps, we created a simple app to display a list of the Accounts a user owns:
When we click on an individual Account record, we see the photo page. We click on the icon to take the photo. This action will perform two functions:
1. Capture the image and add it to a gallery with a unique name.
2. Navigate the user to the photo review page, where the user can decide to delete, retake, or save the photo to SharePoint.
When the User clicks the Save icon, the image will be sent to the Documents folder associated to the Saratoga Boat works account in Dynamics,
When we navigate to the SharePoint folder from the Saratoga Boat works record in Dynamics 365, we can see the image we just took and saved.
So, how did we get the photo to that specific folder? With a Flow! To send the photo to the SharePoint location, we create a Flow using the Create SharePoint File function.
In the Flow, we pass three variables:
1. Folder Path
2. File Name
3. Image Content
In the PowerApps-built app, we have an onclick event that triggers the Flow:
As you can see, we are using a Concatenate function to create the folder name for the account.
And that’s pretty much it. In PowerApps, you call this Flow on press of the save button, which will save the photo in the correct SharePoint folder. Don't forget to subscribe to our blog for more helpful tips!
Cool, huh? As always, happy PowerApps’ing!!