Most times, requirement is as simple as being able to show or hide a ribbon button based on a value of the field on the record.
Let’s consider this scenario, a button on Lead entity called as “Evaluate” exists. It should be only visible if the Lead Source (OptionSet) is set to Partner.
And the button should be hidden if the condition is not satisfied.
Enable Rule based on Value
Now, let’s see how we achieve this –
In Ribbon Workbench, in your Command which is tied to the button, you need to add a Display Rule.
In the Display Rule, you’ll need to select ValueRule.
In the value Rule, you’ll need to specify the field name and the value to consider. So here, the field I want to consider is “leadsourcecode” i.e. “Lead Source” field on the Lead entity and 4 is the value of the Partner option.
and finally make sure your Display Rule is correctly tied to the Command on the button (And yes, the Command should also be tied to the Button itself.)
And finally Publish your changes.
Now, when the Lead has value as Partner, the button will be visible
And when the value is something else, it will be hidden once the record is saved.
Note: In this case if your condition is based on multiple values, consider adding more Display Rules and patch them together using OrRule as one Rule will cater to only 1 value.
Hope this helps!
Here are some more Ribbon Workbench related posts you might want to check out –
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.
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
If you select Approvals and notice the Details field, you’ll see a watermark saying that Markdown is supported.
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.
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.
Let’s look at what happened here –
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)
The reason was that the Filtering Attribute too was added in the Trigger which clashed.
And this was a clash between the two. Hence, the Condition Trigger was not fired.
On the other hand, if the field which is in the Filtering Attributes was changed, the Flow was triggered.
So here are the takeaways –
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.
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 –
As 2020 comes to a close, here’s a Power Automate / Cloud Flows quick tip that might benefit newbies to Power Automate.
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.
You can use Parallel Branching
Select Parallel Branching instead of a normal Step.
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)
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 –
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 –
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!!
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 –
Let’s say this is the OptionSet in Dynamics
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
I’ll capture the Value of the OptionSet i.e. the Value part
What needs to be displayed is the Label of the OptionSet! Let’s see how we can do this –
Actions – List records (Inside Loops)
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 –
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
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.
Assuming you are using List Records and you loop through the outputs of each of these records
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)
Get an Account is a ‘Get a record’ Action in CDS/Dataverse Current Environment connector. It’ll only fetch a single record.
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
Hope this helps!
Here are some Power Automate / Cloud Flow posts you might find helpful –