Showing posts with label Flows. Show all posts
Showing posts with label Flows. Show all posts

Sunday, 12 July 2020

Required properties are missing from object while parsing JSON in Power Automate or Microsoft Flow

Hi Everyone,

Today I am working on a flow and received below error at ParseJSON Step.

"Required properties are missing from object : property names"


This error is coming as we have specified some of the properties as required in the Schema and as they are not given as an input to Parse JSON, the step is failing while validating the data with schema.

To fix this, we have to edit the schema and remove the properties that were mentioned as Required in the schema. 



If you are 100% clear that you might need the values to pass on, I would be prefer to check the data after parsing it and have your own response step to handle it.

Hope this helps.

--
Happy 365'ing
Gopinath

Thursday, 18 June 2020

Get the Count of records in Flow or Power Automate - Dynamics 365 CE

Hi Everyone,

Today I got a requirement to check the record count and do some operation if the count is greater than 1. We are very much used to these kind of checks in C# and just think if we need to the same in Flow.

Here is the way to do. We just need to know one expression for doing it. 

I have a following Action of List Records from CDS connector and renamed it to ListOfAccounts.

Declared an Integer variable and below the expression used for setting the value.

length(body('ListOfAccounts')?['value'])

Once we run the flow, the variable will have the count of accounts that are retrieved by List Records action. We can use same expression in conditions.

Hope this helps.

--
Happy 365'ing
Gopinath

Thursday, 12 December 2019

Server to Server Authentication in Power Automate (Microsoft Flow) - Service Prinicipal

Hi Everyone,

We all know that how important role that Server to Server Authentication is playing now a days. All CDS connections runs under some user context and sometimes we might have to go with Server to Server Authentication. When we setup Service Principal, it will automatically show the UI to give input of Client ID, Client Secret and Tenant ID. Here are the steps for the same.

Select Common Data Service on Flow and select the required action to perform.

Click on ... and select Add Connection.

Click on Connect with Service Prinicipal and enter the required details.

Here is the Step by Step process to configure Application User for getting Server to Server Authentication.

Hope this helps.

--
Happy 365'ing
Gopinath

Friday, 6 December 2019

Terminate Control - Power Automate (Microsoft Flows)

Hi Everyone,

As we all know that Dynamics 365 CE Product Team is recommending Power Automate (Microsoft Flows) instead of Background workflows in CRM. That way, things will be executed completed outside of CRM/CE and there won't any load on the CE instance. Also, Power Automate comes with lot of other features and connectors.

Today, I was exploring Flows and as we have Stop Workflow step in the Workflow, I was checking for the same in Flow and you know, yes we do have the same feature in Flows as well.

Search for Terminate Control in the Action and you will see.


It comes with three options Cancelled, Failed and Succeeded. For Failed, we can give Code and Message. The same would be passed as a response.


Please note Terminate Control terminates (stops) the complete process. 

There is an option to Enter Custom Value for status. However, it is not working  and throws below error while saving the flow.


Hope this helps.

--
Happy 365'ing
Gopinath

Thursday, 5 December 2019

Parallel Loop in Power Automate (Microsoft Flow) - Degree of Parallelism

Hi Everyone,

Today I was exploring something on flows and came to know about "Degree of Parallelism". Here is the more information on the same.

There are many situations, we might loop through the records and do some operation. In this example, I am retrieving records from CE and updating them by looping through each one and it took 2 minutes to complete the operation sequentially. That means only one child record is processed at a time.

We can improve the performance of this by enabling "Concurrency Control" and setting "Degree of parallelism" from Apply Each control settings.

Once we apply the setting, it took only 6 Seconds in my scenario after setting the degree of parallelism to 20 (Max value is 50).

Hope this helps.

--
Happy 365'ing
Gopinath

Monday, 2 December 2019

Calling Flow (Power Automate) from PowerApps - Dynamics 365 CE

Hi Everyone,

In this article, I am going to create a simple Power APP and call a Flow from  it.

Login to your Power Apps environment - https://us.create.powerapps.com/studio/
Select Blank App -> Phone Layout.

Arrange the required Labels, Text Fields and Buttons.

Select Action as shown in the below and click on Flows --> New --> Instant -- From blank.

It will open the below screen and select PowerApps as a trigger.

In the next Select, Search for Common Data Service and select "Common Data Service"
and then in the Actions select Create a new record.

Select the Required entity.

Click on Last Name field and select on Ask in PowerApps to generate a Parameter.

Select other fields and select on Ask in PowerApps (If you don't see Ask in PowerApps, click on See more)

Save the Step and click on New Step as "Respond to a PowerApp or flow"

Click on Add Output and select Text.

Give the Title and select Value as Contact Unique Identifier.

Give the good name to understand the functionality.

Save the flow and move to PowerApps screen.

Select the button on the screen and Click on Flows from Action on the top menu. It shows the flow that was created. Once you select the flow, it shows as Adding.

We have to update the formulate to send the field's value to the flow as below.

The above works things works fine to hit Flow but as we need to capture the Output of it, we have to change it the Formula as below.
"Set(varContactID, power.Run(TextInput1.Text, TextInput2.Text).contactid);"


Select the label on which we have to show the value and set the Variable that is used to store the output from flow on the button click.

Run and test it.



Hope this helps.

--
Happy 365'ing
Gopinath

Thursday, 28 November 2019

Common Data Service (Current Environment) is not visible

Hi Everyone,

Today, I have started exploring Power Automate and while working on that I observed that sometimes Common Data Service (Current Environment) is not visible.

After some search, understood that Common Data Service(Current Environment) is visible from Flows inside Solutions.

You just have to create a Solution and use an existing then start working on Flow, you will see the Common Data Service (Current Environment) Connector.


Hope this helps.

--
Happy 365'ing
Gopinath