Canvas apps are a great way to boost the productivity and way of interacting. This post continues on the first part and will hook our canvas app into our CE environment.
Creating The Flow
The first thing when creating the flow, is addressing the right trigger. Here let’s take the PowerApps one to be able to use it in our Canvas App.
Next is to get the appointment which is viewed in our canvas app. To be aware of this, you need to tell the powerapps connector to ask additional information when the flow is consumed. This is done as follows:
Select the input where you need the information. Then choose the “Ask in PowerApps” option. Worth noting, you currently can’t adapt the name generated for the parameter.
Thanks to the Get Appointment action in your flow, you will be able to use the record found in this part to use its values to get the regarding of the appointment. I just added this action to show this functionality.
To set the image, some logic is needed to perform on the base64 string which is passed to the flow. Therefore, utilize the “Initialize variable” to create a string variable.
Since the base64 string can contain different image types, like jpeg or png, based on the device, I added additional parsing of the string. The if/else will look like this:
In case you have a predefined set of image formats, one should opt for a switch/case statement.
To have a useful base64 string, we just need to adapt it in a way Dynamics CE can read it. This means we need to strip the first part which specifies the format of our image. This looks like this:
replace(triggerBody()['Createanewrecord_Document'], 'data:image/jpeg;base64,', '')
In the end, in the create a new record, you opt for the “Notes” entity and you add the base64 string value to the Document attribute. Mark the option “Is Document” to yes. The mimetype is the value which we stripped in the beginning of the base64 string.
The flow will look in the end something like this:
It’s fairly easy to create a useful interaction with your CE environment without actually writing code or customizing your environment.
If you have any remarks or questions, please leave them in the comments section below.