Split On in Power Automate in SharePoint trigger for Item updates

Let’s consider this scenario where you have a SharePoint List and you need to Bulk Edit the same which triggers a Flow.

How would you want to capture the record updates in Flow Runs – Individually? Or all in an Array?

Let’s see how this can be done!

SharePoint Trigger in Power Automate

Let’s see what trigger is being used on which I can choose to have Split On in case of Bulk Update of Item Changes.

  1. In Power Automate, you can search for SharePoint and you’ll find the trigger on which for Item Update in SharePoint.

  2. Now, since I have a List called 2021 Onboarding in my SharePoint in the Site called Data Store Internal


  3. And this Flow will be triggered whenever there’s an Update to the Items on the List I’ve mentioned above.

Split On

Let’s look at what options are available us to toggle between having Split On and Off and what the results are –

  1. Go to the Settings of the Trigger to access the Split On setting toggle.


  2. You’ll see the Split On is set to ON i.e. as per below –


  3. Given that this can be turned ON and OFF, we’ll look at the difference between the two results when you Bulk Edit SharePoint Items which will initiate this trigger.

Example: Split ON

Now, let’s review how having Split On will affect the results.

  1. Now, let’s see Flow Runs are recorded when Split On is set to ON and the Split is on Body/Value


  2. Now, when I modify multiple items in SharePoint, say, the Group Code field in my SP List as below –


  3. Then, there will be 2 different Flow Runs.


  4. Now, if you look at the results, the way these exist per Flow Run is as follows. And for each record, this is the case –

Example: Split OFF

Now, let’s review how having Split OFF will affect the results.

  1. Now, once the Split is OFF and you Bulk Edit the records.


  2. And when you Bulk Edit the List in SharePoint the same way as you did above,


  3. Only 1 Flow Run will be created as shown below –


  4. And, if you open the results, you’ll see the multiple items in the body – value (Array of each record as value in the body) which were modified.


Hope this was useful!

Here are some more Power Automate / SharePoint Online posts you might want to check –

  1. Admin Center URLs under M365 – Power Platform, Teams, SharePoint, Power BI
  2. AddColumns() function to dynamically add columns to a Data table in Canvas Power App | SharePoint List
  3. Launch URL on a Data Table Text column selection in a Canvas PowerApp | SharePoint Lists
  4. Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate
  5. Advanced Lookup in Model-Driven Apps | Power Platform
  6. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  7. Adaptive Cards for Teams to collect data from users using Power Automate | SharePoint Lists
  8. Aggregate functions in a Canvas Power App | Using on SharePoint Lists
  9. Save generated PDFs to SharePoint directly – 2020 Wave 1 | Early Access Feature
  10. D365 Ribbon Button shortcut to open a Document in SharePoint Online

Thank you!

Search Rows (preview) Action in Dataverse connector in a Flow | Power Automate

As Dataverse connector keeps getting updated from time to time, here’s a new Search rows (preview) Action which you must be seeing in the Dataverse connector in Power Automate. Let’s see how we can use this Action.

As it suggests, that this is still in preview! So kindly take a note of that.

Search Rows (Preview)

  1. Search rows is an Action in the Dataverse connector and you’ll be able to see it like this

Enable Relevance Search

  1. Let’s assume you went ahead and used this connector in your Flow without having Relevance Search enabled in your D365 CE organization, you’ll see the Search Rows throw the below error.


    And the error is described as –

  2. To make Search Rows work, Relevance Search must be enabled for you Dynamics 365 CE / CRM environment. Head over to the System Settings in Dynamics 365 under Settings > Administration > System Settings. And in General tab, look for Relevance Search option, check-mark it and save.


  3. Here’s the full Microsoft Documentation on how to use queries for Relevance Search – https://docs.microsoft.com/en-us/powerapps/developer/data-platform/webapi/relevance-search?WT.mc_id=DX-MVP-5003911

Using Search Rows action

Let’s see how this Action from the Dataverse connector will work –

  1. Now, once you have selected the Search rows action, below are the features which I’ll explain one by one –

  2. Let’s first look at the last item i.e. Return row count. As it says, will result the count of results returned if set to Yes.
    Will return -1 if set to No.

  3. For Search Type and Search Mode to be covered, these need to be explained extensively since it covers several factors. To keep it short for now, I’ve linked the Search Type and Search Mode documentation as below
    https://docs.microsoft.com/en-us/power-automate/dataverse/search#search-type?WT.mc_id=DX-MVP-5003911

    And the short Summary of the same is:
    Search Type:simple | full” There are 2 types called as simple and full. Default = simple. Both have different functions within them that you can use on the Search Term.

    Search Mode: “any | all” By Default – any. This defines if any criteria of the Search Term is to be considered or all must be true based on different syntax and operators used.
  4. Row Count denotes how many records should the results Return which is standard across other Dataverse actionss.
  5. Also, Row Filter uses OData style filtering which we’ll omit in this example to keep it simple. 😊
  6. Now, let’s enter a Search Term and keep it simple, I’ll pick an example: “Contoso“.
    Next, look at the Table filter – If I leave it blank it’ll search for Contoso across all Tables in Dataverse.


    Result to show from all Tables as per the above Search rows term –


    Now, I’ll add account and contact (I do have some records in the Opportunity as well which has the keyword ‘Contoso’. So those will be filtered out)


    And the result will be as follows –


    And if we look at the Raw Outputs to see how data is retrieved, we get the below –

  7. Now, let’s look at Sorting.
    Now, in the Sort by filter, I’ll enter the field name ‘name‘ and desc as the order of the Sort.
    And then, we’ll check the results


    And the results were as below –


  8. Next, let’s look at Facet Query. basically, it drills down on the Results which are already returned as a part of the main query and serve as metadata for the same to gather similar information together.
    Here’s how I enter a Facet query – Ex: contact.address1_city. Meaning, it’ll return Address 1: City from all the returned Data and store it under Facet Query.


    Now, when we run this, we’ll get the following results –


  9. Let’s look at what Skip Rows does.
    It’ll only omit the records from the already returned Results. Example: Even if the Result returned 5 records, it’ll Omit/Skip first x records. But still show that the Results returned are whatever the Query is supposed to return.

    In the below example, out of 5, I’ll skip 4 rows.



    And when you run the Query, you’ll find that the Record Count is 5, but only 1 entry was available in the Output.



Which Columns are Searchable?

There are 2 points to keep in mind to know and configure which all columns will the Search be performed on.

  1. If you are aware of how you can configure the Quick Find views in Dynamics 365 CE, same is applicable here since this works off of Relevance Search itself.
    In any Table/Entity’s Quick Find view, make sure the columns are selected in the Add Find Columns

  2. The ones selected in Find Columns are the ones on which the Search will be performed.

Here’s a YouTube video I made to demonstrate the same –

Hope this was useful!

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

  1. Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate
  2. Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate
  3. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  4. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  5. Asynchronous HTTP Response from a Flow | Power Automate
  6. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  7. Tag a User in a Microsoft Teams post made using Power Automate
  8. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  9. Formatting Approvals’ Details in Cloud Flows | Power Automate
  10. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  11. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  12. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip

Thank you!

Suppress Workflow Header Information while sending back HTTP Response in a Flow | Power Automate

Let’s see how we can suppress critical information about the Flow to the caller HTTP Application while sending back a response.

Scenario

The Flow will send Header information back while sending a HTTP Response to the caller HTTP Request.

  1. Here’s how the Flow will look –

    Note, that we are sending a Custom Header along as well.

  2. And along with this info, the follow Header information will also be visible in the calling application. We’ll use Postman to check this scenario.

    You’ll see that a lot of Headers have been sent back along with our Custom Header.


    And you’ll see whole lot of Headers that expose the Flow details in these Headers.

    Let’s see how we can cut this information short and not send back any unnecessary information to the HTTP Request we’ve received.

Suppress Workflow Headers in HTTP Request

Let’s see how with a simple tweat, we can avoid sending the Workflow Header information back as HTTP Response.

  1. We go to the Settings of the HTTP Request Trigger itself as shown below –


  2. Now, you see the option, Suppress Workflow Headers, it will be OFF by default.


    Your turn it ON,


  3. Now, let’s try to make a call again and see the difference. Going back to the Postman, we Send another request post you’ve saved the workflow changes above.

    We see that only 10 Headers are sent as opposed to 24 as seen without suppressing the info.

  4. And if we see what Headers are sent back, we see along with our Custom Header, only the ones which are required will be sent suppressing all the critical information.

    This is a good practice to suppress Workflows that don’t give out information in production scenarios which are not required by end application.

I’ve also made a quick YouTube video of the same. Check it out as well –

Hope this was useful!

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

  1. Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate
  2. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  3. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  4. Asynchronous HTTP Response from a Flow | Power Automate
  5. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  6. Tag a User in a Microsoft Teams post made using Power Automate
  7. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  8. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  9. FormatDateTime function in a Flow | Power Automate
  10. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  11. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  12. Secure Input/Output in Power Automate Run History

    Thank you!

Invalid XML issue in Dataverse connector for List Rows action | Fetch XML Query | Power Automate

While using Dataverse connector [formerly known as Common Data Service (Current Environment) connector] for different operations, List Rows is one of the common Actions we use in Flow implementations with Dataverse.

If using FetchXML Query as filter is your choice, there one of the most common issues with an XML is having an Invalid XML due to the special characters in the data we are passing.
Many times, this issue goes unidentified since we end up checking only syntax!

Here’s what you can also add as an additional check to escape the special character scenario in FetchXML query in a List Rows action.

Invalid XML Issue – Special Character

Let’s look at one of the common examples where you’ll see this error on runtime when a FetchXML issue appears

  1. You have a Flow wherein you are using FetchXML query to list records in Dataverse connector using List Records action.


  2. But when happens is, when this Flow Runs, it results in an error on the List Records step.


  3. And if you look at the right hand pane for the error, it could be a Invalid XML error which you would get in Dataverse (or while working in Dynamics CRM if you have experienced in the past).


  4. So, let’s look at what could be wrong in this case among several other reason of using FetchXML and getting syntactical errors.
    If you look at my XML below, it looks like there could be some parameters that have special characters in them and hence, your XML might fail if not anything else.


    Let’s look at how we can resolve the same.

encodeURIComponent() function

As a solution to this, you can use the encodeURIComponent function in Flow to counter this problem –

  1. Now, in ideal cases, you parameters could be coming in from elsewhere which you would add in the FetchXML as parameters.
    Let me store the same in a sample String Variable for now.


    In the Value, I’ll look for an expression called as encodeUriComponent()



  2. Then, I simply enter the value which I’ll pass on to the Fetch XML filter to be used later on. And then I enter the value in the function.


    And it looks like this in your variable.


  3. Now, you just pass this on to the Fetch XML itself.

  4. And now, this should work successfully

Here’ is the Microsoft Docs of the function to encore URI and help streamline special characters – https://docs.microsoft.com/en-us/azure/logic-apps/workflow-definition-language-functions-reference#encodeUriComponent?WT.mc_id=DX-MVP-5003911

Hope this was helpful!

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

  1. FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate
  2. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  3. Asynchronous HTTP Response from a Flow | Power Automate
  4. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  5. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  6. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  7. FormatDateTime function in a Flow | Power Automate
  8. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  9. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  10. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip

Thanks!!

FetchXML Aggregation in a Flow using CDS (Current Environment) connector | Power Automate

Getting the count of records or averaging is one of the most commonly used Aggregate Functions in programming. FetchXML queries too facilitate aggregation. So here’s how you can utilize the same in a Flow using Common Data Service (Current Environment) connector [Because I’m waiting for it to be renamed to Dataverse Connector yet 😊]

To know about Fetch XML aggregation, here’s the Microsoft Docs link for the same – https://docs.microsoft.com/en-gb/powerapps/developer/data-platform/use-fetchxml-aggregation?WT.mc_id=DX-MVP-5003911

Scenario

Let’s assume, you want to get the count of records from a Common Data Service (Current Environment) connector. Here’s how you can do the same using existing Aggregate Functions provided by Fetch XML.

Disclaimer: This is of course, not he only way to get get the aggregate functions, you can implement custom logic after you’ve retrieved all the data as well.

  1. Here’s the Fetch XML I’ll be using to retrieve all the Accounts from the Dataverse environment.
    I’m using List Rows action from the connector which is this


    And this is the query which I generated from the Advanced Find in D365 CE


  2. Below are the changed I must make to work with Aggregates in Fetch XML.
    in the <fetch>, I’ll set aggregate=”true”
    And the columns which I’m using the Aggregate function on, I’ll mention the aggregate=”[Aggregate]” alias=”[AliasName]”

  3. Now, this query along won’t run and you’ll get the below error –
    An attribute can not be requested when an aggregate operation has been specified and its neither groupby not aggregate. NodeXml: [FirstAttributeInQuery]

  4. The reason being, since you are using Aggregate, only the columns on which aggregates are applied must exist. Hence, you’ll need to remove the other attributes which don’t have aggregate applied to them.
    |
  5. And the workable FetchXML will now look like this

  6. When you run this, these are the results you’ll get in which you’ll have the aggregate value.

  7. Observe the same below

Parse JSON to read the aggregate

Now, since you’ve got the aggregated results. You can do an extra step to read the value. There are several ways to contain this, but here’s a quick example of how I did it –

  1. Declare a variable. It must be outside of a For Each at all times.

  2. And in the For Each, because I’m selecting the Array inside the value attribute in the Fetch XML results, I can then use the sample data to generate the schema and use it. The loop will anyway run only once.

  3. And I’ll set the variable below

  4. And here’s the final result once you run it. Your scenario of usage may vary.

Hope this was useful!

Here’s a YouTube video I made to summarize this example –

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

  1. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  2. Secure Input/Output in Power Automate Run History
  3. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  4. Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector
  5. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  6. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  7. Asynchronous HTTP Response from a Flow | Power Automate
  8. FormatDateTime function in a Flow | Power Automate
  9. Tag a User in a Microsoft Teams post made using Power Automate
  10. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  11. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  12. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate

Thank you!!

Parsing Outputs of a List Rows action using Parse JSON in a Flow | Common Data Service (CE) connector

For newbies using Common Data Service (Current Environment) Connector, it might be a little puzzling to find all the records and other supporting output data while parsing from a List Rows action in the connector.

Here’s my post summarizing the same and helping you show what is in the output when and then you can make a decision!

Before we begin, please note the connector Icon at the time of writing this post – The tooltip if hover on will read as “Common Data Service (Current Environment)

List Rows

So, here’s what my List Rows action looks like

  1. I’m retrieving 10 Accounts in this example

  2. Now, I’m adding 4 Parse JSON variables to hold the different Outputs from the Dynamic Content of the List Rows.
  3. I’ll rename the first Parse JSON as Value and add Value from the Dynamic Content from List Rows output


  4. Second, I’ll rename the Parse JSON to Body and add Body from the Dynamic Content to it.

  5. Third, Parse JSON is renamed to Item and I’ll select the body/value – Item first.


    And as soon as I do that, the Block gets converted to For Each, because Item is list of all the records directly

  6. Finally, in my fourth Parse JSON block, I’ve renamed it to Outputs of List Rows and added the outputs of the List Rows step itself using outputs() function – More on outputs() here – Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate


    Now, let’s Run the Flow and see what results we get!!

Value / Body / Item

Now, let’s look at the output JSON data from each of these blocks and see what we get –

  1. Value. I used JSON Beautifier to parse and look at the JSON data and here’s what it looks like.
    Body attribute and has array of all the records.


  2. Next, Body. Body has similar data as values but with some additional attributes to support the same.
    Then, the array of all the records under Value attribute instead of directly appearing under Body in the Value block above. I know it’s a little puzzling — 😊


  3. The, Item. It’s a simple JSON of a single record itself. Hence, it exists inside a For Each loop


  4. And finally, the outputs() of the List Rows action entirely, it has Body, Header and other


    But, note that the Body is also another attribute inside the main Body tag and sits next to Headers and StatusCode

I’ve also embedded my YouTube video explaining the same –

Here are some Power Automate / Flow posts which you might find worth checking out –

  1. Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate
  2. Asynchronous HTTP Response from a Flow | Power Automate
  3. FormatDateTime function in a Flow | Power Automate
  4. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  5. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  6. FormatDateTime function in a Flow | Power AutomateUsing outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  7. Formatting Approvals’ Details in Cloud Flows | Power Automate
  8. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  9. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  10. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate

Thank you!!

Invalid type. Expected Integer but got Number error in Parse JSON – Error at runtime after generating Schema | Power Automate

If you are using JSON Parse function in Power Automate and are comfortably generating schema from Trigger Outputs (or any Output for that matter), to get the Dynamic Content but end up getting the below error even after generating the Schema by parsing actual data itself?

Let’s look at why this happens.

Scenario / Issue

Now, below is the usual step you follow to generate the schema –

  1. Let’s assume you are reading from the body of the CDS trigger. Again, it could be anything. And you are using Parse JSON and generating schema as below –


  2. And the schema is generated as below –

  3. I’ll point out an exception here. The above Schema was generated from a Schema whose data in decimal had 0.0

  4. Hence, when you generated the Schema from the Data, the Data’s Type was set to “integer



  5. So, when 0.0 passes through the parse, it’s successful because it is interpreted as 0 and not 0.0
  6. Now, when something like 2.5 passes through it, it gives the below error.



Solution

  1. Since you can’t be always aware that the data you are using for parsing is an actual Decimal or a Whole Number, so in that case, simply change the Type of the Schema in JSON Parse change to “number

  2. Now, in this case, if you resubmit the same Run again, it will pass through in case there are no other issues.

Hope this helps!!

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

  1. Asynchronous HTTP Response from a Flow | Power Automate
  2. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  3. Tag a User in a Microsoft Teams post made using Power Automate
  4. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  5. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  6. FormatDateTime function in a Flow | Power Automate
  7. Formatting Approvals’ Details in Cloud Flows | Power Automate
  8. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  9. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  10. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  11. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  12. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform

Thank you!!

Asynchronous HTTP Response from a Flow | Power Automate

By default, whenever yo submit an HTTP Request to a Flow, your application will wait till the request is completed. Meaning, the HTTP Response by default in a Cloud Flow is Synchronous.

So, let’s see how you can make it Asynchronous and how you can later retrieve the status of the HTTP Request itself from the Flow. If you make a HTTP Response as Asynchronous, the calling HTTP Request application will receive a 202 Accepted in response.

HTTP Request by Default

Let us see how the HTTP Request and Response is structured by default.

  1. Here’ s the HTTP Request which will receive the request and process the data further.

  2. And let’s assume you some lengthy process involved in your Flow which is making an average execution time span to a significant time. To mimic that, I’ve simply introduced a delay of 3 minutes to demonstrate the Async example.

    In case you want to review how to pause a Workflow using Delay and Delay Until, you can check this post – Pause a Flow using Delay and Delay Until | Power Automate
  3. And finally, assuming my execution of the Flow has completed and I’m supposed to send the Response back to the HTTP Request calling application, I’ll use the Response Action from the Request connector
    }
  4. And my Response will look something like this letting the caller application know that the processing has been successfully completed.


    Now let’s see how this calling application will behave in this case. Assuming, we haven’t manipulated any settings as yet.

    The Flow looks like this just to give you a visual perspective of the implementation.

  5. Now, Once I send a Request from Postman, the Postman itself will be waiting for a response till the execution of the Flow is completed.


  6. This is because the Flow itself is waiting to be processed and yet to reach the Response block in the Flow.

Asynchronous Response

We will now turn on the Asynchronous Response of the HTTP Response Action –

  1. Go to Settings on the Response action step.


  2. In Settings, turn on Asynchronous Response On and save it.

  3. As mentioned in the description of the Asynchronous Response setting, the caller Application will immediately get a 202 Accepted code upon sending the HTTP Request.

  4. Notice the Headers, you’ll see a Location header item

  5. Capture this URL in your calling application as you can use it to check the status of the Request later on once the operation is completed on the Flow.

Checking Request Status

Since we have the Location information which was passed on from to the Response Header previously, we can use the URL to check the Response Status separately by making another call to the URL itself.

  1. If the Status is still Running, you’ll get this response. It will imply that the Flow is still Running and the Response is not available yet.


  2. Else, you’ll get the actual Response which was supposed to be received had the Flow’s HTTP Response was set to Synchronous by default (Asynchronous Response = OFF)


Hope this was helpful!

I’ve added a YouTube Video for the same. You can alternatively, check the same as well –

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

  1. Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate
  2. Call HTTP Request from a Canvas Power App using Flow and get back Response | Power Automate
  3. Accept HTTP Requests in a Flow and send Response back | Power Automate
  4. Setting Retry Policy for an HTTP request in a Flow | Power Automate
  5. Make HTTP request from Flow in Power Automate
  6. Connecting XrmToolBox to an MFA enabled Dynamics 365 environment | Azure ADFormatDateTime function in a Flow | Power Automate
  7. Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
  8. FormatDateTime function in a Flow | Power Automate
  9. Form Access Checker in new Power Apps Form Designer | Model-Driven Apps in Dynamics 365Formatting Approvals’ Details in Cloud Flows | Power Automate
  10. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  11. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  12. Make On-Demand Flow to show up in Dynamics 365 | Power Automate
  13. Adaptive Cards for Outlook Actionable Messages using Power Automate | Power Platform
  14. Run As context in CDS (Current Environment) Flow Trigger | Power Automate

Thank you!!

Validate JSON Schema for HTTP Request trigger in a Flow and send Response | Power Automate

In a Cloud Flow, if you are using an HTTP Request Trigger that accepts HTTP Requests – you have the option to validate the Incoming data based on the Schema of the JSON.

Scenario

Let’s assume this is the data which will be passed to the HTTP Request Flow –



HTTP Request & Schema

Let’s look at the HTTP Request Trigger itself in a Cloud Flow –

  1. First, let’s initiate the HTTP Request Trigger here and make sure we generate the Schema from the same data we will be passing. I also have a separate post on the HTTP Request itself which you can check here – Accept HTTP Requests in a Flow and send Response back | Power Automate
     
  2. Here, we can paste the sample data which we saw in the scenario above.

  3.  Once you click Done, the Schema will be generated from the sample data you’ve just entered. Additionally, if needed you can also specify the method you are looking to implement. POST in this case


  4. Further on, I’m doing some operations internally and finally, I’ll be sending a response to the caller using the HTTP Response Action in HTTP connector in a Cloud Flow

  5. And here is what I’m sending back in Response if my Flow happens to work as expected.

  6. So, the end of my Flow looks something like this. (Depending on what you are trying to do in your Flow)



     

Turning Validation On

Now, coming back to the HTTP Request trigger itself –

  1. Go to Settings on the HTTP Trigger itself –


  2. Now, look for Schema Validation option and turn it on.


Now, let’s consider the scenario and test the Postman.

Testing with Postman – Validation On

Let’s try to send incorrect data to the Flow using Postman which doesn’t comply with the Schema and see how we receive the 400 Error message in Postman

  1. Now, when I try to send the correct data as expected by the Schema once the validation is turned on, I’ll get a success message once the Flow has finished running and return with a 200 code


  2. Now, if we try to send incorrect data, it will not be accepted. So first, I’ll add a new attribute which I’ve not added in the schema already in order for the validation to fail and give us an expected validation error.
    See the data which I’m sending. To which, I get the 400 Bad Request error

  3. If you get back a 400 Bad Request, the Flow will not register it as a Flow Run. Hence, you won’t know if the Flow was hit or not.
  4. And in case the validation is turned OFF, you’ll get the Response as expected from the Flow in the event that Flow has completed successful execution.

Hope this post helped!

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

  1. Tag a User in a Microsoft Teams post made using Power Automate
  2. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  3. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  4. FormatDateTime function in a Flow | Power Automate
  5. Formatting Approvals’ Details in Cloud Flows | Power Automate
  6. Trigger Conditions not working in a Cloud Flow? Here’s Why | Power Automate Quick Tip
  7. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  8. InvalidWorkflowTriggerName or InvalidWorkflowRunActionName error in saving Cloud Flows | Power Automate Quick Tip
  9. Setting Lookup in a Flow CDS Connector: Classic vs. Current Environment connector | Power Automate Quick Tip
  10. Using outputs() function and JSON Parse to read data from missing dynamic value in a Flow | Power Automate
  11. Using triggerBody() / triggerOutput() to read CDS trigger metadata attributes in a Flow | Power Automate
  12. Secure Input/Output in Power Automate Run History

Here are som

Tag a User in a Microsoft Teams post made using Power Automate

As Power Automate becomes more of a norm to make Microsoft Teams in a channel, tagging a user is one of the most frequent and obvious asks for Power Automate / Flow developer.

Here’s how you can take a User from Office 365 to a Teams channel.

Let’s look at these straight-forward steps! It’s easy.

Getting a Mention Token

First, let’s create a Mention token. Let’s see how –

  1. In Microsoft Teams connector in Power Automate, look for Get @mention token for a user (preview)

  2. This Action step asks for a User Principal (If you are using an Active Directory) or a User ID which needs to be tagged/mentioned.

  3. Let’s enter an User Principal or User ID here. I’m hardcoding this for visibility, your scenario would vary.


Use Token in a Post to Teams

There are different ways to Post a message to Teams. Let’s see the options.

  1. Below are some options to post a message to Teams

  2. Let’s go with Post a message (v3) (preview) for this example to post a message to Teams.

  3. Finally here’s how your step would end up looking with the Mention tag added in the message to be posted in ex: Open Board Meetings Teams’ General Channel.

Post in Teams

So here’s how the post will look once the Flow is run and the message is posted to Teams

Hope this was helpful! Here are some more Power Automate / Flow posts you might want to check out –

  1. Converting JSON to XML and XML to JSON in a Flow | Power Automate
  2. Visualize Adaptive Card for Teams user action within a Cloud Flow | Experimental Feature
  3. Create a Team, add Members in Microsoft Teams upon Project and Team Members creation in PSA / Project Operations | Power Automate
  4. Task Completion reminder using Flow Bot in Microsoft Teams | Power Automate
  5. Office 365 Outlook connector in Cloud Flows showing Invalid Connection error | Power Automate
  6. Import multiple Users in Office 365
  7. Read OptionSet Labels from CDS/Dataverse Triggers or Action Steps in a Flow | Power Automate
  8. Turn Teams On / Off at Org Level, provisioning users | M365 Admin Center Tip
  9. FormatDateTime function in a Flow | Power Automate
  10. Approval Process using Power Automate

Thank you!