User Review
( votes)Dynamics 365 Marketing is a powerful application within Dynamics 365 that allows for the easy management and deployment of digital marketing campaigns. Included within this is the ability to create and schedule social media posts.. As part of Dynamics 365 and the greater Microsoft suite of business apps, Dynamics 365 Marketing allows for easy integration between Microsoft products. This includes the workflow automation tool, Power Automate, formerly known as Microsoft Flow.
Power Automate allows users to create automation flows within other Microsoft apps and some 3rd party applications. With the help of Power Automate, you can create a social post approval process in Dynamics 365 Marketing. This flow automatically sends social post drafts to a designated approver when marked for approval in Dynamics 365. The approver then receives an email with the name and text of the post along with a direct link to the draft in 365 Marketing. From there, the approver can schedule the post.
Create the flow
To get started making the flow, navigate to Dynamics 365 Marketing Social Posts and select New. On the editor page, there will be a Flow drop down on your top tool bar. Select new to begin creating the approval flow.
It will default as a common data service button, which is what you are looking for. Since we initiated it through the social post editor, it should have your first step set up already. If not, it should be titled “When a Record is Selected.” The environment can be left at Default and the entity should be “Social posts.” Next, create an “Initialize Variable” step. It is not fully necessary in this instance, but in longer flows with multiple of the same kinds of steps, you may want to rename them to something more specific. We can call this one “Post Link”. The name field should be “Post Link” and select String in the Type drop down. Value can be left blank. This step creates a variable that will be used in the process to give a link to the draft of the social post in Dynamics 365 Marketing.
The Process Scope
A scope step is essentially like a file divider. It keeps similar functioning actions together. Scopes keep your flow organized as you can collapse it when you are working on a different step. Rename this scope to Process Scope, or something similar that makes the most sense to you. This scope will be what sends the email to the approver. Add a “Set Variable” and “Send an Email(V2)” action. Either email action should work fine, however the original is no longer receiving updates. In the “Set Variable” action, enter “Post Link” in the name field. The value function may be confusing, but Power Automate makes it pretty easy to get through it.
When clicking into the field, you should see a Dynamic Content window appear. Within this window click the Expression tab. Look for a function called “concat(text_1, text_2,…).” In the next step you will replace the two placeholder texts. Open another tab and navigate to a social post in 365 Marketing. Copy the web address and paste it into Word document or notepad. It should look like this:
https://[Your URL]&pagetype=entityrecord&etn=msdyncrm_socialpost&id=c6e087e9-7209-eb11-a813-000d3a17769f
Delete the section after “socialpost&id=” and keep everything else. This will replace “Text_1” in the concat function. This is input as a string, so you will need to put apostrophes on both ends of the link. The second placeholder is much simpler. All you need to do is replace “Text_2” with the “Social posts” variable from the dynamic content window where you got the concat function.
Now, the flow will combine the static portion of the URL with the unique ID for each social post. With the Set Variable action complete, we can move on to the email. The email action is simple and completely customizable based on what information you want to include for the approver. Add the email address of the approver and give it a relevant subject. In the body, you can add dynamic content to give a preview of the post within the email itself. In our Flow, we use Name, Post Text, and the Post Link variable that we created.
The Failure Scope
This is technically an optional step, but we have found that including a failure scope in flows provides quicker notification if something goes wrong. Power Automate does give notifications if a flow fails, but it can sometimes delay the email, or try to bunch them together. This scope sends an email immediately upon failure of the process scope.
To add this, create a scope step and rename it Failure Scope. In the settings dropdown of the scope, which looks like an ellipsis on the right side, set the run condition to failure of the process scope. Add two actions into this scope. One will be an email and the other Terminate. Set the email up to send to whomever is your flow manager. Be sure to specify in the subject and body which flow has failed. On the Terminate function, you only need to set the Status field to Failed. Everything else is fine to leave blank. This action just makes sure the flow stops in case of failure.
This flow simplifies the process of sending social posts created in Dynamics 365 Marketing off for approval. With Power Automate, it is easy to create these kinds of automatic processes without requiring a super extensive coding background. If you have questions or want to learn more about what Dynamics 365 Marketing and Power Automate can do for your company, Schedule a 45-minute discovery call with a Dynamics 365 Consultant to talk through your situation and answer any questions you may have!