Formatting Approvals’ Details in Cloud Flows | Power Automate

Now, not always Approvals details/description should appear as plain text. In order to enrich the Details of an Approval Adaptive Cards (which you can send as part of standard Approvals provided by Cloud Flows / Power Automate)
In this post, I’ll be looking at an example to format Details for a “Start and wait for an approval” Action step in Power Automate / Cloud Flow


You can enrich the Details so that they appear easy to read and are more meaningful.

Scenario

Let’s say I receive the below Approval with the Details mentioned as below.

And the Details section as you see appears bland without formatting. Let’s format the same using some Markdown examples.

Markdown Support for Details in Approvals in Cloud Flows

  1. If you select Approvals and notice the Details field, you’ll see a watermark saying that Markdown is supported.

  2. Markdown is a light-weight markup language for formatted text. MS Docs Official Link for all Markdown usage: https://docs.microsoft.com/en-us/power-automate/approvals-markdown-support?WT.mc_id=DX-MVP-5003911
  3. Let’s look at how the below plain text can be enriched using Markdown

  4. Now, understanding how Markdown is used from the documentation provided above, you can format the details as below –

  5. And the formatted Details section looks more meaningful and appealing.

Hope this helps!

Here are some more Power Automate / Cloud Flows posts you might want to look at –

  1. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  2. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  3. Parallel Branching in Cloud Flows – Isolate Response dependent Step Actions in parallel branches | Quick Tip
  4. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  5. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  6. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  7. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  8. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  9. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  10. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate

Thank you !!

Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip

At times, you’re pretty sure that the trigger condition you’ve put in a Cloud Flow is correct but it still doesn’t trigger.

Scenario

Here’s a scenario which I came across where the Trigger Conditions weren’t triggering. The trigger was Common Data Service (Current Environment) connector and the Trigger Conditions were supposed to check for a specific value to fire.

However, even upon fulfilling the criteria, the Flow was not firing.

Here’s why

Let’s look at what happened here –

  1. Now, as expected the Flow should have triggered when my field Account Type has Option Set value of 3 i.e. “Partner”(on the label)

  2. The reason was that the Filtering Attribute too was added in the Trigger which clashed.

  3. And this was a clash between the two. Hence, the Condition Trigger was not fired.
  4. On the other hand, if the field which is in the Filtering Attributes was changed, the Flow was triggered.

Takeaway

So here are the takeaways –

  1. Trigger Conditions won’t fire even if the condition is matched because there’s a Filtering Attribute added to an Update trigger on the Common Data Service (Current Environment) connector.
  2. Even if Trigger Condition exists, the Filtering Attributes takes higher precedence and hence, an update on the Filtering Attributes will trigger rather than Trigger Conditions.

Hope this helps!

Here are some more Power Automate / Cloud Flows posts you might want to check –

  1. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  2. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  3. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  4. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  5. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  6. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  7. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  8. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  9. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  10. Terminate a Flow with Failed/Cancelled status | Power Automate

Thank you!!

Parallel Branching in Cloud Flows – Isolate Response dependent Step Actions in parallel branches | Quick Tip

As 2020 comes to a close, here’s a Power Automate / Cloud Flows quick tip that might benefit newbies to Power Automate.

Scenario

Some Flows need you to include Approvals or Adaptive Cards that halt the execution of the Flow until the Response from the target is sent back to the Flow.

If there are some steps to be taken after the Response is received.

Parallel Branching

You can use Parallel Branching

  1. Select Parallel Branching instead of a normal Step.

  2. Now, all the Response dependent Actions should be in one of the Branches – (Denoted by Red Box and arrow). And the other part where the execution is expected to be carried forward should be in the other branch – (Denoted by Green Box and arrow)




  3. The execution will then wait where the parallel branches merge finally. Else, each branch can choose to end independently if there are no inter-dependent actions to be take, like taking Response from the Parallel Branch as well. The Waiting state will look like this –


  4. Now, when the Response is submitted back, the Flow execution will continue from the point of convergence of the two parallelly separated branches.

With this, you can separate dependent activities by using Parallel Branching.

Hope this was useful!

Here are some more Power Automate / Cloud Flows posts that you might like to go through –

  1. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  2. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  3. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  4. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  5. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  6. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  7. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  8. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  9. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  10. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists

Thank you!!

Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate

Retrieving OptionSet Labels from CDS data in a Cloud Flow / Power Automate / Flow is an extra step than just picking from the Dynamic Values. Check this post!!

Scenario

While working with data that is either a result of a Dataverse Trigger (on Create/Update) or Action like (Get record, list record), the OptionSet fields from CDS/Dataverse return the Values of the OptionSet instead of the Text Labels –

  1. Let’s say this is the OptionSet in Dynamics

  2. And when you pick the OptionSet field from CDS either from an Action or a Trigger like this
    Let’s say I’m capturing this in a variable to show you


    I’m storing this in a variable for this example to show you

  3. I’ll capture the Value of the OptionSet i.e. the Value part


    Result –

  4. What needs to be displayed is the Label of the OptionSet! Let’s see how we can do this –
    1. Triggers
    2. Actions – List records (Inside Loops)
    3. Actions – Get record (Single record)

triggerOutputs() / triggerBody() to read the OptionSet values from Triggers

Let’s see how to read the OptionSet values from CDS Triggers, Create or Update –

  1. When a Flow is triggered using CDS/Dataverse Triggers (I’m using Common Data Service Environment(Current Environment) trigger), you can read the OptionSet value by using triggerOutputs() / triggerBody() function –
    Here’s a triggerBody() example

    Now, notice that the name of the field is cf_accounttype. So, the label in Triggers can be retrieved as _cf_accounttype_label and NOT cf_accounttype.

    Same way, you can also use triggerBody() function instead as well to yield the same result


    Here’s a post on triggerBody() / triggerOutputs() for your reference – Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

items() to read the OptionSet values from Action Step – List Records (Multiple Records)

Let’s look at this example where you are retrieving multiple records using List Records and now, you apply a loop on each of those to read individual records.

  1. Assuming you are using List Records and you loop through the outputs of each of these records


  2. Now, the value is represented by items() function on the Loop that you are in i.e. Apply to each.
    Hence, the function is
    items('Apply_to_each')?['cf_accounttype@OData.Community.Display.V1.FormattedValue']


    This will show the label of the OptionSet in the results


outputs() to read the OptionSet values from Action Step – Get a record (Single Record)

Similar to items() function, we can use outputs() function to read from the Output’s of the Get a Record Action from Common Data Service (Current Environment)

  1. Get an Account is a ‘Get a record’ Action in CDS/Dataverse Current Environment connector. It’ll only fetch a single record.

  2. Now, let’s look at how outputs() function, similar to items() function used in case of Loops is used.
    Formula is –
    outputs('Get_an_Account')?['body/cf_accounttype@OData.Community.Display.V1.FormattedValue']

    In the above scenario, I’m reading under body hierarchy for cf_accounttype@OData.Community.Display.V1.FormattedValue

Using JSON Parse to get the values

Finally, there’s also a method in which you can create a Parsed JSON from the Outputs

  1. Pick JSON from the Actions, it is under Data Operations connector and is a very popular one.

  2. Now, you’ll need to pass Outputs of the CDS Step to the Inputs of the Parse JSON step. Now, since you don’t already have a schema yet, Just put {} and save (else, you won’t be able to save)

  3. Now, Run the Flow once where the CDS step was successful and copy the Outputs from the Body

  4. Now, go to the same Parse JSON Step and click on Generate from Sample

  5. Now, paste the copied Body to generate the schema.

  6. Once you click OK, the schema will be generated.


  7. Finally, you can select the Parsed schema and use it as Outputs.


    And it will appear as below –


    Again, this will also show the same results as the above approaches.

Hope this helps!

Here are some Power Automate / Cloud Flow posts you might find helpful –

  1. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  2. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  3. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  4. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  5. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  6. Run As context in CDS (Current Environment) Flow Trigger | Power Automate
  7. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  8. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  9. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  10. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  11. BPF Flow Step as a Trigger in CDS (Current Environment) connector | Power Automate
  12. Pause a Flow using Delay and Delay Until | Power Automate

Thank you!!

InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip

If you are lately started creating Flows, you’ll come across some errors which are not precisely directing to what might be the issue but throw an error that says as below –

For Triggers (InvalidWorkflowTriggerName) –

Run Action (InvalidWorkflowRunActionName) –

Reasoning

The reason you see these errors are because of Invalid Characters which are in your Flow Trigger Step Names or on the Flow Action Step Names.

Invalid Characters in Trigger Names


Invalid Characters in Action Step Name.

Hence, the Step Names shouldn’t contain the below special characters –
< > % & ? / \

Note: Trigger/Step Names can’t end with a Full Stop (.). However, if there’s a Full Stop in between, it’ll work

Hope this was helpful!

Here are some more Power Automate posts you might want to check out –

  1. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  2. ChildFlowUnsupportedForInvokerConnections error while using Child Flows [SOLVED] | Power Automate
  3. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  4. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  5. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  6. Setting Correct Default Mode for Forms in a Canvas App | [Quick Tip]
  7. Pause a Flow using Delay and Delay Until | Power Automate
  8. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate

Thank you!