Power automate flow Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/tag/power-automate-flow/ Microsoft Dynamics CRM . Microsoft Power Platform Wed, 27 Dec 2023 11:52:02 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 Power automate flow Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/tag/power-automate-flow/ 32 32 176351444 Get working days and holidays of the CRM Service calendar in Power Automate Flow http://microsoftdynamics.in/2023/12/27/get-working-days-and-holidays-of-the-crm-service-calendar-in-power-automate-flow/ Wed, 27 Dec 2023 11:52:02 +0000 https://www.inogic.com/blog/?p=36874 With Microsoft providing us more flexibility with Power Automate (MS Flow), we can now retrieve working days and holiday details of the CRM Service Calendar directly within Power Automate flows. Previously we used Plugins or JavaScript to get Calendar’s working days and holiday details, but now they can be directly retrieved through the Power Automate...

The post Get working days and holidays of the CRM Service calendar in Power Automate Flow appeared first on Microsoft Dynamics 365 Blog.

]]>
With Microsoft providing us more flexibility with Power Automate (MS Flow), we can now retrieve working days and holiday details of the CRM Service Calendar directly within Power Automate flows. Previously we used Plugins or JavaScript to get Calendar’s working days and holiday details, but now they can be directly retrieved through the Power Automate (flow) as well.

Recently, we got a requirement to check whether a specific date is a business/working day considering weekends and public holidays defined in the Service calendar of CRM.

Below are the workdays defined in the CRM:

Power Automate Flow

Below is the list of holidays defined in the CRM which are observed:

Power Automate Flow

Given a specific date, we were supposed to check whether it is a working day considering the weekends and public holidays defined above.

The Power Automate Flow steps to get Working Days per week

Step 1: Retrieve Calendar (Customer Service Type)

First, add the ‘List Records’ step to retrieve the ‘Customer Service’ type Calendar. Use a filter query to fetch the calendar by its name and type. To capture the necessary GUID for the next step.

Power Automate Flow

Step 2: Retrieve Calendar (Working Days)

Now, proceed to fetch the working days for the previously obtained calendar. Utilize an ‘Apply to Each’ step to iterate through each calendar, and within that, add a ‘Get a Row by ID’ action to retrieve the working day’s calendar using the expand query. The expanded query allows us to seamlessly expand related tables in the list rows action. In this case, the main table is Calendar while the related table is Calendar Rules where the weekly working days pattern is stored.

Power Automate Flow

Power Automate Flow

In the ‘Compose’ action, we can find the calendar working days enumerated. Using the following formula:

If (    empty(outputs('Get_a_Calendar_which_contains_working_days')?['body/calendar_calendar_rules'][0]?['pattern']), -1, Substring (      outputs('Get_a_Calendar_which_contains_working_days')?['body/calendar_calendar_rules'][0]?['pattern'],        add(indexOf(outputs('Get_a_Calendar_which_contains_working_days')?['body/calendar_calendar_rules'][0]?['pattern'], 'BYDAY='), length('BYDAY=')) ) )

Power Automate Flow

Power Automate Flow

The Power Automate Flow steps to get Holidays

Step 1: Retrieve Calendar (Holiday Schedule Type)

First, use the ‘List Records’ step to retrieve the ‘Holiday Schedule’ type Calendar. Apply a filter query to fetch the calendar by its name and type. The result will provide the necessary GUIDs for the next step.

Power Automate Flow

Step 2: Retrieve Calendar Rules (Holidays)

Now, proceed to fetch the calendar rules for the previously obtained calendar. Utilize an ‘Apply to Each’ step to iterate through each calendar, and within that, add a ‘Get a Row by ID’ action to retrieve the calendar rule.

However, note that attempting to fetch the calendar rule directly will result in an error saying “The ‘Retrieve’ method does not support entities of type ‘calendarrule’”,

Power Automate Flow

Power Automate Flow

Power Automate Flow

As a workaround, we can retrieve the calendar rules along with calendar data using the expand query.

Power Automate Flow

Power Automate Flow

In the ‘Compose’ action, we can find the calendar rules enumerated using the following formula:

outputs(‘Get_a_calendar_which_contains_holidays’)?[‘body/calendar_calendar_rules’]

Power Automate Flow

Power Automate Flow

Step 3: Get Holidays details

For each calendar rule, implement an ‘Apply to Each’ loop. Within this loop, incorporate a Compose action to extract the holiday name, as illustrated.

Power Automate Flow

Conclusion

Using Power Automate, we can retrieve Calendar and Calendar Rule details which allows users to handle complex requirements, such as checking working days while considering weekends and defined holidays.

Microsoft Power Platform

 

The post Get working days and holidays of the CRM Service calendar in Power Automate Flow first appeared on Microsoft Dynamics 365 CRM Tips and Tricks.

Please visit the Source and support them

The post Get working days and holidays of the CRM Service calendar in Power Automate Flow appeared first on Microsoft Dynamics 365 Blog.

]]>
4829
SharePoint file created from power automate flow doesn’t show open correctly or corrupted. http://microsoftdynamics.in/2023/05/20/sharepoint-file-created-from-power-automate-flow-doesnt-show-open-correctly-or-corrupted/ Sat, 20 May 2023 13:54:48 +0000 https://microsoftdynamics.in/?p=4704 created a file from a Dynamics 365 CRM record attachment and when I try to load it into SharePoint it doesn’t create or read correctly? Even if it appears to upload correctly, it may not open properly and display something like this: Consider the following scenario. Suppose you have attached a document in SharePoint and...

The post SharePoint file created from power automate flow doesn’t show open correctly or corrupted. appeared first on Microsoft Dynamics 365 Blog.

]]>
created a file from a Dynamics 365 CRM record attachment and when I try to load it into SharePoint it doesn’t create or read correctly?

Even if it appears to upload correctly, it may not open properly and display something like this:

Consider the following scenario. Suppose you have attached a document in SharePoint and want to save it in Notes.

  1. Let’s say you have uploaded this PDF document to Notes and now you want to upload it to SharePoint.
  2. I have a flow that sends this document to SharePoint that runs when I create a note in the Dataverse (Dynamics 365 CRM).”
  3. Now the “Create File” action in SharePoint looks like this:
    This allows the SharePoint file creation action to add the document to the file context. Hovering the mouse over this will result in triggerOutputs()?[`body/documentbody`].
  4. Running this flow creates a document in SharePoint. However, when I open the file, I get an error message that the file cannot be read, even though the file appears to upload correctly.Please click on the link to find correct way to

    Create a file from a Dynamics365 CRM record attachment notes and move to SharePoint documents. without corrupted file.

Use base64ToBinary conversion

Here’s a step to create a File in SharePoint in your mentioned SharePoint library –

  1. In order to correctly pass this through, use the base64ToBinary expression in the Create file’s File Content field.
  2. And in base64ToBinary, put the Document so that it looks like this – “base64ToBinary(triggerOutputs()?[‘body/documentbody’])
  3. And when you re-run the test, the document will be created in the same way.
    And now when you open it, it’ll open properly.

The post SharePoint file created from power automate flow doesn’t show open correctly or corrupted. appeared first on Microsoft Dynamics 365 Blog.

]]>
4704
UCI How Dynamic URL work in UCI with some additional application mode parameters http://microsoftdynamics.in/2020/09/29/uci-how-dynamic-url-work-in-uci-with-some-additional-application-mode-parameters/ Mon, 28 Sep 2020 23:49:18 +0000 http://microsoftdynamics.in/?p=4179 Explaining Unified client interface URL Parameter and how it dynamically change the value while navigating to different pages

Table of Contents:

00:00 - Introduction
00:29 - UCI Dynamics URL parameters
01:32 - Unified client Interface URL Explained
03:16 - Cmdbr or command bar
03:54 - NavBar or Navigation Bar
04:23 - Create a power automate the flow
06:39 - Get Environment URL in Power automate
08:19 - Create Dynamics Record URL in ms Flow
10:31 - Add dynamics URL in Email

The post UCI How Dynamic URL work in UCI with some additional application mode parameters appeared first on Microsoft Dynamics 365 Blog.

]]>

Explaining Unified client interface URL Parameter and how it dynamically change the value while navigating to different pages

Table of Contents:

00:00 – Introduction
00:29 – UCI Dynamics URL parameters
01:32 – Unified client Interface URL Explained
03:16 – Cmdbr or command bar
03:54 – NavBar or Navigation Bar
04:23 – Create a power automate the flow
06:39 – Get Environment URL in Power automate
08:19 – Create Dynamics Record URL in ms Flow
10:31 – Add dynamics URL in Email

One of the Interesting thing in UCI is the way URL changes while navigating between pages examples

If we navigate to Entity form PageType = Entity , ent=logicallname , ID = guid

If we Navigate to Entity List PageType =EntityList , ViewID =GUID

If we navigate to Dashboard PageType = Dashboard with ID

As per the above image, the URL contains 3 parts

  1. URL of Environment: when we talk about the dynamic Record URL it should also consider when we move from UATto production we should not change it in the Production manual it should automatically take the URL of Environment.DVMSKEUAT.CRM.Dynamics.com to DVMSKEPROD.CRM.Dynamics.com
  2. App ID: Each App has it unique Id if you want that Entity to open in a specific App we need to Define it in the URLappid = GUID
  3. CMD Bar: CRM Bar is the bar where we navigate throw cmd buttons. We can remove/add-in from window by putting cmdbar= false/true

  4. NavBar: This is the Blue bar of CRM where we navigate app and entity history, We can Remove/add in form window by setting navbar=on/off

  • PageType: it is used to define type of page , Example pagetype=dashboard , pagetype=entitylist , pagetype=entity  E.T.C

  • ENT: ent stands for Entity where we define the name of entity example account, contact, incident in our case
  • ID: this defines GUID unique id of the page type or entity we want to retrieve data for example if we  using pagetype= Dashboard it will need GUID of Dashboard

Thank you.

The post UCI How Dynamic URL work in UCI with some additional application mode parameters appeared first on Microsoft Dynamics 365 Blog.

]]>
4179
Trigger Power automate using WebHook (Plugin Registration tool) and throw exception / response in real time http://microsoftdynamics.in/2020/09/14/trigger-power-automate-using-webhook-plugin-registration-tool-and-throw-exception-response-in-real-time/ Mon, 14 Sep 2020 12:53:28 +0000 http://microsoftdynamics.in/?p=4148 As we know we can use WebHooks to creating external handlers for server events, like azure service bus or any other web service.

in this post

we will create power automate with action as ” when an HTTP request is received”
Get HTTP Post URL, Will break the URL as URL and parameters
Register a webhook using the plugin registration tool
Register a step on the update of the account name.
Adding the “Response” action in power automate to see exception in CRM using webhook

The post Trigger Power automate using WebHook (Plugin Registration tool) and throw exception / response in real time appeared first on Microsoft Dynamics 365 Blog.

]]>

In our last 3 posts, we checked 3 different methods of triggering Power automate, Below are the links

In today's post, we will check 4th method of triggering Power automate flow using WebHook in the plugin Registration tool

As we know we can use WebHooks to creating external handlers for server events, like azure service bus  or any other web service.

in this post

  1. we will create power automate with action as ” when an HTTP request is received”
  2. Get HTTP Post URL, Will break the URL as URL and parameters
  3. Register a webhook using the plugin registration tool
  4. Register a step on the update of the account name.
  5. Adding the “Response” action in power automate to see exception in CRM using webhook

Check1: Create Power automate with Action "When a HTTP request is recived"

  1. Create Instant flow and select action “When a HTTP request is Received”  with Method as post and Payload generic

  2. Once Saved we will get the URL , copy the URL and Break it down as below to specify HTTP query parameter in webhook.

    https://prod-25.centralindia.logic.azure.com:443/workflows/73a854555aaa5fad8f867ac168/triggers/manual/paths/invoke
    
    api-version=2016-06-01
    sp=/triggers/manual/run
    sv=1.0
    sig=Sxfp4x5V51JDEeSYuf4mvxTXlGR2xTxn3WeQiab00yY
    

Check2: Register WebHook to trigger power atomate flow and Register an Step for acccount update

  1. Login to plugin Registration tool and register new WebHook with Below config and Http Post URL.

  2. Now Register new Step on Update of Account entity, field = account name.

  3. All Done, If we want to add some condition and throw an exception for any condition, we can do so by adding “response ” in  Power automate

It would be a kind of realtime exception even we know the flow is meant to be working in async.

The post Trigger Power automate using WebHook (Plugin Registration tool) and throw exception / response in real time appeared first on Microsoft Dynamics 365 Blog.

]]>
4148
AND & OR Operator conditions in Power automate expression condition http://microsoftdynamics.in/2020/06/30/and-or-operator-conditions-in-power-automate-expression-condition/ Mon, 29 Jun 2020 19:59:40 +0000 http://microsoftdynamics.in/?p=3796 In Trigger Condition or simple dynamics Expression, it easy to add an expression, below is examples of how we can add AND & OR conditions in Expression ion Power Automate
Below Example is for AND
If Title Contain Refund AND Trigger Body New_Text field equals Refund Credited

The post AND & OR Operator conditions in Power automate expression condition appeared first on Microsoft Dynamics 365 Blog.

]]>

Click Here For Full PostFilter Query , Expand Query in Power Automate flow – Get Collection of record from CDS

Click Here For Full PostTrigger condition expression example for each field Datatype in Power Automate

In Trigger Condition or simple dynamics Expression, it easy to add an expression, below is examples of how we can add AND & OR conditions in Expression ion Power Automate

  • Below Example is for AND
    If Title Contain Refund AND Trigger Body New_Text field equals Refund Credited

  • The same way we can add OR condition and with multiple expression below we have only used 2 Expression
    If Title Contain Refund OR Body New_Text field equals Refund Credited

The post AND & OR Operator conditions in Power automate expression condition appeared first on Microsoft Dynamics 365 Blog.

]]>
3796
My ClipBoard – Copy paste action in power automate tips http://microsoftdynamics.in/2020/06/10/my-clipboard-copy-paste-action-in-power-automate-tips/ Wed, 10 Jun 2020 14:20:29 +0000 http://microsoftdynamics.in/?p=3597 Sometimes power automate flow become lengthy and when there are repeating steps with few tweaks and tricks that and manually mapping everything is frustrating but there is a Copy past feature most of us has seen but I never tried it ( tried using CTRL + V )

But while working on long logic flow felt the need of knowing how this power automates action copy past work.

The best part is we can also use this copied action across different Power automate the flow

The post My ClipBoard – Copy paste action in power automate tips appeared first on Microsoft Dynamics 365 Blog.

]]>

Sometimes power automate flow become lengthy and when there are repeating steps with few tweaks and tricks that and manually mapping everything is frustrating but there is a Copy past feature most of us has seen but I never tried it ( tried using CTRL + V )

But while working on long logic flow felt the need of knowing how this power automates action copy past work.

You will notice a tab at the very end of choose an action “MY Clipboard”, if you have not copied anything , this would be blank.

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5ee0e91faae43.png?fit=1356%2C491

we can find Copy to my clipboard option on Action 3 dot section

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5ee0e9f1ee19d.png?fit=1830%2C717

After Coping thee Action, it would be available on My Clipboard

https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/06/img_5ee0ea0f3a087.png?fit=1617%2C469

The best part is we can also use this copied action across different Power automate the flow

But there are some pointers to keep in mind

  1. After coping we have to resolve the references
    I.e  body(‘Get_response_details_forms_lead‘)?[‘r8c8b777a372645dfb3f715f60e4c6b78’] is copied and pasted to different Section to flow, there the body name of reference can be different body(‘Get_response_details_forms_Contact‘)?[‘r8c8b777a372645dfb3f715f60e4c6b78’]
  2. Connections can be different for other flow or step

The post My ClipBoard – Copy paste action in power automate tips appeared first on Microsoft Dynamics 365 Blog.

]]>
3597