• Release History
  • Documentation
  • Back to www.mscrm-addons.com
  • Release History
  • Documentation
  • Back to www.mscrm-addons.com
home/Knowledge Base/DocumentsCorePack(DCP)/How to trigger a Microsoft Flow from dialog

How to trigger a Microsoft Flow from dialog

1384 views 0 Updated on July 25, 2022

With the new option to call a Flow from the ‘Create Document‘-dialog, DocumentsCorePack users can utilize the full suite of Power Automate to process documents or add logic as needed for their business process.

How it works

Visit flow.microsoft.com, navigate to “My Flows” and press “New Flow“.


Figure 1: Power Automate – Flows

Press “New Flow” and a drop-down list offers you some choices. Select “Instant cloud flow”.


Figure 2: Create new Microsoft Flow

The “Build an instant cloud flow”-site opens. First, give your flow a name. Then scroll down to “When HTTP request is received” and make a tick. Press the [Create]-button.


Figure 3: Build an Instant Cloud Flow

Click on the “When a HTTP request is received” action header to open the details.


Figure 4: Enlarge by clicking the header

Please note: Only Flows with a specific trigger (“When a HTTP request is received”) will work.
The following “Request Body JSON Schema” has to be added to the Flow (Just copy and paste it).

{
"type": "object",
"properties": {
"AMWIID": {
"type": "string"
},
"RecordID": {
"type": "string"
},
"RecordLogicalName": {
"type": "string"
},
"File name": {
"type": "string"
},
"File size": {
"type": "integer"
},
"Document (Base64 encoded)": {
"type": "string"
},
"Mime-Type": {
"type": "string"
},
"ActivityLogicalName": {
"type": "string"
},
"ActivityId": {
"type": "string"
}
}
}


Figure 5: Inserted Request Body JSON Schema

The request JSON Schema defines the data that will be delivered to the Flow:

  • “AMWIID” – It is the ID from the AutoMergeWorkingItem which was created in the dialog.
  • “RecordID” – ID of the start data record from which the dialog was started
  • “RecordLogicalName” – Logical Name of the start data record (e.g.: account, quote, contact, opportunity,…)
  • “File name” – Name of the file that was created
  • “File size” – Size of the file that was created
  • “Document (Base64 encoded)” – Document content as Base64 string
  • “Mime-Type” – Document type that is given (e.g., application/pdf)
  • ActivityLogicalName – Logical name of the activity (e.g.: email, letter, phonecall,…)
  • ActivityID – ID of created activity

As you can see it contains both: Information of the record (RecordID) the document was generated for as well as the document itself.
Thus, it is now possible to use this information in your flow to work with the document as well as peform operations in your Dynamics 365 instance (DataVerse) as required by your business process.

To activate this flow in your environment, you need to add the following MSCRM-ADDONS.com Settingskey (Learn more about how to create a Settingskey):
Name: MicrosoftFlows
KeyValue: [FlowName1]|[FlowUrl1];[FlowName2]|[FlowUrl2]…
Product: AutoMerge

In this example it is looking like this:


Figure 6: New created SettingsKey

In your Dynamics 365 you can see under “My Flows” the success of your newly created MicrosoftFlow.

Example: Save a document to Onedrive and store the link back to the Record in Dynamics 365.

This example shows how a document generated for a Quote inside the Sales Hub can be uploaded to a specific folder on Onedrive as well as storing the URL of this file back to the Quote inside the Sales Hub.

Flow-Setup: Instant Cloud flow with https-trigger as outlined above.

Actions:

  • Upload file to Onedrive: Here we can use the Filename and Document (Base64 encoded) paremter provided by the https-trigger.
  • Save URL back to Dynamics record: Here we use the RecordID provided by the https-trigger to identify the quote-record so we can do an update of the Description-field to hold information on the file upload.


Figure 7: Actions


Figure 8: Result

Send a response from Flow to DocumentsCorePack dialog:

There is also the option of sending a response back to the dialog. 

Example for specified data in a JSON format:

{
"EntityReferences": [
{
"LogicalName": "[Entity Name 1]",
"Id": "[GUID 1]"
},
{
"LogicalName": "[Entity Name 2]",
"Id": "[GUID 2]"
},
]
}

In this response you can specify data records in a JSON format, which are then opened by the dialog.


Figure 9: Response

With the additional option (response) you can automatically update/open the “Quote” in order to see the result directly in the description.


Figure 10: Result – opened by the dialog

That’s it! We appreciate your feedback! Please share your thoughts by sending an email to support@mscrm-addons.com.

Was this helpful?

Yes  No
Related Articles
  • How to share the Connection of the DocumentsCorePack Connector
  • AssureSign for DocumentsCorePack
  • How to conditionally remove a watermark in DocumentsCorePack templates
  • Document Processing with DocumentsCorePack (DCP)
  • How to activate SharePoint in DocumentsCorePack
  • Fillable PDF forms
Leave A Comment Cancel reply

You must be logged in to post a comment.

Latest Articles
  • How to share the Connection of the DocumentsCorePack Connector
  • How to update the metadata in the DocumentsCorePack Template Designer
  • Working with Product Properties in DocumentsCorePack
  • How to work with the Relationship Manager
  • Using virtual tables in DocumentsCorePack
Popular Articles
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
  • DocumentsCorePack Template Designer – Getting Started
  • mscrm-addons.com Application Access for Dynamics 365 (App Access) – DocumentsCorePack
  • DocumentsCorePack Online Service Configuration
  • Step-by-Step: How to configure a One-Click-Action
Top Rated Articles
  • IMPORTANT information for Dynamics 365 online customers using DocumentsCorePack and/or AttachmentExtractor
  • How to activate the DocumentsCorePack connector for PowerApps & Microsoft Flow
  • Step-by-Step: How to configure a One-Click-Action
  • Online Services: Required Application Permissions
  • Where do I find the Unique Organization name in Microsoft Dynamics 365?
Categories
  • *News and General Infos* 51
  • Webinars 35
  • Template Designer(DCP 179
  • DocumentsCorePack(DCP 192
  • TelephoneIntegration (TI 65
  • AttachmentExtractor (AE 62
  • PowerSearch (PS 48
  • ActivityTools (AT 59
  • SmartBar (SB 53
  • GroupCalendar (GC 46
Our Vision

“We see it as our purpose to provide products that simplify and speed up our customers’ Microsoft Dynamics 365 experience.”

Knowledgebase
LogIn
mscrm-addons.com
  • Products
  • Online Shop
  • Downloads
  • My Account
About Us
  • About Us
  • Case Studies
  • Newsletter
  • Partner Program
  • Contact
Support
  • Support
  • Terms & Conditions
  • Documentation
  • Webinars
  • Legal Documents
  • Impressum
  • © 2022 www.mscrm-addons.com. All Rights Reserved.