Enable / Disable (turn on / turn off) multiple cloud flows – Dataverse


Within the Maker Portal, we can only turn on / turn off one cloud flow at a time.

If we select multiple flows, we do not see that option.

Here we can make use of XrmToolBox’s Bulk Data Update plugin.

Get the required cloud flows to be disabled from the Workflow table having Category as Modern Flow.

Select the required cloud flows (or all flows returned), navigate to the Set State tab, and set the appropriate Status and click on Update records.

Or, from the Advanced Find also we can look for the Processes with the Category as the Modern Flow

And use Activate and Deactivate options (here for a few flows we faced issues while trying to activate even though we used the proper account for doing so)

Hope it helps..

Advertisements

Auto-create SharePoint Folder (SharePoint Document Location) on record create using Power Automate Flow (Dataverse)


We recently had a requirement to create the SharePoint folder automatically on the Account records creation, instead of having the users click on the Documents tab to create it.

We could write a Power Automate flow to achieve this.

Here we have enabled the Share Point server-based integration. Also, the SharePoint Site and the main or parent folder for the Account are already created/configured.

Below is the corresponding Document location record for the parent Account folder.

  • So basically, we will create a new folder inside the Account folder in the SharePoint site configured in CRM.
  • Then create a new SharePoint Document Location record specifying the Account document location as a parent.
  • And then Associate / Relate the new account record created with this new document location record.

Below is how our Flow will look like –

  1. Triggers on Account record creation.

2. Create a new folder inside Account Folder, here for the name of the folder we are using the format “AccountName_AccountNumber

3. Create a new Document Location record, associating the Account document location with the parent location record. Here we are specifying the same folder name in the relative URL.

We can also fetch the GUID of the Account document location and/or use a variable to store the GUID.

4. Lastly, we are associating these 2 new records.

Below is our newly created account record.

Below we can see our flow ran successfully.

We can see the new folder created and associated.

Here if we click the Documents tab immediately after creating the account record, before our flow runs, we might have the OOB folder also getting created along with our custom folder (flow being asynchronous). If our custom folder is already created and associated before the user clicks on the documents tab, then CRM will not be creating a new folder.

Hope it helps..

Advertisements

How to – Upload a file by URL to SharePoint (Power Automate / Dataverse)


Recently we had a requirement to upload a document (pdf) to a SharePoint folder.

We had the URL of the field saved in one of the fields of the Contact table in Dynamics 365 / Dataverse.

Below is our field and the URL in it. (the URL points to the Manual of Fulla 2, one among many awesome products by Schiit)

Below is how our flow looks like

Here we already have Server-Based SharePoint integration enabled. https://nishantrana.me/2023/07/28/based-on-entity-behavior-for-sharepoint-folder-dynamics-365-dataverse/

The flow triggers when there is an update in the File URL field of the contact record.

Next, we are using HTTP action to use the GET method to get the content of the file. As it is a public URL we haven’t specified any Authentication.

Next, we are using Create File action of SharePoint, we have specified the Site Address, Folder Path, File Name, and most importantly the Body of the HTTP action to the File Content property.

On the successful run of the flow,

we can see the document (pdf) uploaded in the SharePoint folder.

Hope it helps..

Advertisements

Date Time Fields (Date Only and User Local – Behaviour) in Power Automate (Dataverse)


Recently we faced an issue in our flow that was showing a different date that the date entered by the user for a date time field.

Let us look at the below scenario to understand it.

Say we have the below field Date and Time with Time Zone Adjustment as User Local created in CRM / Dataverse.

Now user enters the below value in in the field and saves the record which triggers the flow.

The user’s time zone is set as below

Now in our Power Automate flow, we can see the UTC date for it.

2023-08-27T20:00:00Z

Now to convert to the user’s New Zealand Time Zone we can make use convertTimeZone function here

convertTimeZone(triggerOutputs()?[‘body/cr0e8_mydatetimefield’],’UTC’, ‘New Zealand Standard Time’, ‘MM/dd/yyyy’)

We get the date as expected i.e. 28th

Now let us change the Format of the field to Date Only, and we keep the Time zone adjustment as User Local only.

Let us trigger the flow again. (now we don’t have the time part)

We get the date without time part as expected.

But this time the convertTimeZone
function doesn’t work, as we only have the Date part and it is not in the UTC format.

convertTimeZone(triggerOutputs()?[‘body/cr0e8_mydatetimefield’],’UTC’, ‘New Zealand Standard Time’, ‘MM/dd/yyyy’)


Check this thread that talks about it –

https://powerusers.microsoft.com/t5/Building-Flows/Dataverse-Date-only-field-is-set-1-day-off-from-original-value/td-p/805859

Here one quick fix could be to change the Time zone adjustment to Date Only or Time zone independent for that field(i.e. no time zone conversion).

https://learn.microsoft.com/en-us/power-apps/maker/data-platform/behavior-format-date-time-field#date-and-time-column-behavior-and-format

Now triggering the flow again, we get the below values –

as now there is no time zone conversion for that field.

Hope it helps..

Advertisements

Fixed – URL was not parsed due to an ODataUnrecognizedPathException or Bad Request – Error in query syntax (Power Automate)


We got the below error while trying to set a lookup field because of the incorrect syntax.

or

The incorrect syntax / formula –

It should be either logicalcollectionname(GUID)

Or logicalcollectionname/GUID

https://nishantrana.me/2022/06/20/fixed-resource-not-found-for-the-segment-in-power-automate/

After setting it correctly, the flow ran successfully.

Hope it helps..

Advertisements

Getting Started – Installation and Setup Kupp Code Analytics


In the previous post, we covered key features and capabilities of Kupp Code Analytics – the powerful Visual Studio Extension for Power Platform and Dynamics 365 Developers.

You can refer to it here

In this blog post, we’d cover the installation and setup of the Kupp Code Analytics extension.

To get the extension, inside Visual Studio Marketplace, we can search for it and download the appropriate extension.

Below we can see that there are 2 versions of the extension available, one for Visual Studio 2022 and the other for Visual Studio 2019.

Visual Studio 2022 – https://marketplace.visualstudio.com/items?itemName=KuppSoftware.kca2022

Visual Studio 2019https://marketplace.visualstudio.com/items?itemName=KuppSoftware.KuppCodeAnalytics2019

We can also install it from inside Visual Studio, navigate to Extension, search for Kupp Code Analytics, and download the extension.

Click on Install / Modify (if already existing) to start/modify the installation.

Below we have successfully installed the extension for Visual Studio 2019.

Next, we need to specify and activate the License

We have 2 types of licenses available for the extension.

Community License (free)– Select type Single, enter the contact details and click on Activate to apply for the community license. Clicking on Activate activates the license instantly.

Enterprise License – This is paid license for the enterprise, that comes with additional features and capabilities not available in the Community license.

We can contact the sales team of Kupp for it – https://kuppsoft.com/contact/

Once added, we can see and manage the license information in Tools >> Options >> Kupp Code Analytics >> License

With Extension Installed, and the license activated, the next step is to configure the tool to connect to our Power Platform / Dynamics 365 Environment.

Navigate to Extensions >> Kupp Code Analytics >> Connection >> Configure

Select the appropriate connection or deployment type

Here to connect to Dynamics 365 Online, we keep the Deployment type as O365 and click on Load Organization

This opens the sign-in dialog where we can provide the appropriate account details.

After successful sign-in, we see all the environments populated to which the user has access. Select the environment, we want to connect to.

After selecting the environment, we can click on the Test D365 button and test the connection.

On a successful connection, we will get the success message as shown below.

Clicking on OK will close the connection dialog box, and the tool will start the process of downloading the metadata for the environment connected. The download should be complete in a matter of a few seconds.

This completes the installation and configuration part of the extension. In the next blog post, we’d cover the key features of the extension in detail.

Also don’t forget to check out the other intuitive products developed by Kupp Software GmbH –https://kuppsoft.com/our-products/

Hope it helps..

Advertisements