Tip #1252: Creating a Planner task with Flow: wait a minute

If you use Microsoft Planner to plan your project tasks, you may want to automate creation of tasks. You can do this with Microsoft Flow.

You will notice that you can’t update fields like the task description when you create a task–this is actually a separate step, called update task details. But if you try to create a Flow that creates a task and immediately tries to update the details, the Flow will fail with a record does not exist error.

To avoid this issue, add a 1 minute delay between creation of the task and update of the details.

Cover photo by unsplash-logoXu Haiwei

Tip #1251: Run workflow when something did not happen

Flow is all the rage these days but there are some scenarios where classic workflow still rules. Classic workflow has the uncanny ability to readjust itself when underlying data you’re waiting for, changes.

This dialog took place not so long ago:

Steve “Reads his own blog” Mordue: I want to trigger a workflow to update an account record if a case has not been created in the last 30 days for the account. Any ideas?

Yours truly: So let me get this straight… You want to run a workflow when something does not happen. That’s a new one.

SM: Yes

YT: How about this.

  1. Create a field on account ‘Last case created on’. Have a workflow that fills that in with the current date on case create.
  2. Have another workflow waiting on that field that kicks in 30 days after the date. It will readjust itself as the field gets updated.

SM: I like it

Just to be fair. If you have bazillions of the accounts and quantamarillions of cases, you might end up with a large number of waiting workflows. Some people have beef with that so those might want to consider Guido “Future olive farmer” Preite‘s suggestion of a scheduled Azure Function to perform the check every day. GP did admit that it was a developer’s suggestion meaning that SM ignored it.

Cover photo by unsplash-logoAnthony Ginsbrook

Tip #1250: Forms won’t load in Chrome

With Joel being busy or lazy, I’m claiming credit for that one even though I have nothing to do with it.

Problem: Classic UI [allegedly – t.j.] has an issue in v8.x where Chrome will just keep ‘spinning’ on some of the forms without returning anything.

Solution: Add an empty JS file to the form.

Explanation: Forms with no custom JS may not properly initialize the OOB script objects. Obviously a Microsoft/Chrome issue but, in a pinch, add an empty js file and that tells Dynamics to go initialize all javascript objects (including its own).

Joel trying to be funny: Legacy form rendering also works if you’re feeling destructive.

Time to upgrade: Unified interface doesn’t have this issue

Tip #1249: Talk back from canvas to model-driven

Until now, embedded canvas apps were a mere eye candy. But with just announced new capabilities you can now talk back to the form. Kind of. More “bark orders” than “talk” but this is awesome start!

Embedded canvas apps now provide the ability to perform actions to navigate, refresh and save the host form. With these capabilities makers can now achieve even richer integration between the embedded canvas app, the host form and other assets in the model-driven app, unlocking an entire new set of scenarios to help meet business needs.

Anees Ansari, Principal Program Manager

Blog post: https://powerapps.microsoft.com/blog/embedded-canvas-apps-can-now-navigate-refresh-and-save-the-host-form/

Documentation: https://docs.microsoft.com/powerapps/maker/model-driven-apps/embedded-canvas-app-actions

Now, how about letting us talk to form context? 😉

Tîpp Jäår

Cover photo by unsplash-logoHarli Marten

Tip #1248: Stop using OrganizationProxy

One of the topics discussed during the MVP Summit 2019 was the brexit of SOAP API. I thought we dealt with it already but there is an additional small but important message:

Stop using OrganizationProxy

Matt “Platform Deity” Barbour

Hold on, you may ask, didn’t you tell us that IOrganizationProxy is fine? Yes, it is, with a capital ‘I’. Interface IOrganizationProxy is fine (and recommended for use in the plugins), but class OrganizationProxy is not. Use CrmServiceClient instead, if you must.

Cover photo by unsplash-logoThomas Le

Tip #1247: Why you should rename your steps in Flow

When you start using Flow, it is tempting to just add your triggers and actions and go, but there is one small detail you don’t want to forget–rename those steps.

For those who don’t know, you can click the … on a step in Flow and select rename.

This will then let you rename the action step to something that makes more sense than “Update record 3.”

So why is that important?

  1. It will save you a lot of time later, especially if you have more than a few steps. If you see multiple actions called “condition,” you will have to click into each one to see what they do.
Renaming the steps makes managing complex Flows easier

2. It will reduce your chances of messing up later. When I insert a dynamic value into a field or expression, I’m presented with all of the field values from each of the triggers and actions before this one–so if you have multiple get contact record actions (or multiple entities with similar sounding fields, like account and contact), you will have to be sure you are picking from the correct one. If you don’t rename your steps, selecting the right one becomes exponentially harder.

The step name is included in the dynamic content selector.

3. It is considerate to those who come after you. If you are building a Flow that your company will be using for important business functions, you will likely not be the only one who ever needs to work on that Flow. By renaming your steps, you will set a good example of Flow best practices for those who work on the Flow in the future, and they will more easily be able to figure out what you did.

Bonus tip–name the steps first

You may find the “rename” option is grayed out and you cannot rename a step. The reason for this is because other steps depend on this step, and you can’t rename a step if it is referenced in a subsequent step.

Can’t rename because a subsequent action references its output

That’s why “build the Flow first then rename the steps” is a bad idea–if you get a complex inter-related Flow going, you will not be able to rename the action steps, causing you to either redo a lot of your work or give up and leave your generically named actions.

Cover photo by unsplash-logoBrett Jordan

Tip #1246: Use “Get Record” to get all the fields in Flow

TIP UPDATE–after further testing, it appears that this tip may not be necessary. Get record is helpful if you need to get additional details from a related record, but you should not have to do get record after an update trigger.

You create a Flow that runs when a record is updated. Occasionally the Flow fails on one or more step with a template error that reads something like the following:

Unable to process template language expressions for action ‘Check_if_Last_Name_contains_data’ at line ‘1’ and column ‘1823’: ‘The template language expression ‘triggerBody()[‘lastname’]’ cannot be evaluated because property ‘lastname’ doesn’t exist.

You think: of course the lastname property exists–it’s one of the standard fields and it is available to be selected from the field list.

Not so fast–take a look at your failed flow and expand out the when a record is updated. You will notice that none of the fields that do not contain data (nulls) is included in the list.

If you will be referencing fields from the updated record, insert a get record step after the when a record is updated step–then when you reference a field from the record that equals null, the Flow will succeed.

Cover photo by unsplash-logoBrian Taylor

Tip #1245: Tops and bottoms in April ’19 Release

It’s great to see the team advising us in advance about the upcoming features in the April ’19 Release Notes. As with any forward document, it is a living and breathing beast. Some features are being postponed, some replaced, new stuff added.

Some of the late-comers are new FetchXML operators. How often you wanted to send season greetings email to your best customers, or perhaps, even a gift? Where do I get 80% of my revenue from? By the same token, wouldn’t be great to know the customers you can live without – who generates large number of support calls but brings little to no revenue?

Now you can define both, top and bottom subsets of your customers with the new Top and Bottom filters in Advanced Find:

For these operators to appear, administrators need to enable the feature in admin center under Settings > Behavior:

So, once the feature enabled, how do you define the top and bottom records? That’s the best part. The settings are per user and per entity (currently accounts only) giving you full freedom to do whatever you want without affecting the others. There are plenty available options but if your choice is not there you can always opt for “Custom” and define your own FetchXML filter:

For developers: the operators extend FetchXML schema as following:

<xs:simpleType name="operator">
  <xs:restriction base="xs:NMTOKEN">
    <xs:enumeration value="eq" />
    <xs:enumeration value="neq" /> 
    ...
    <xs:enumeration value="top-notch" />
    <xs:enumeration value="absolute-bottom" />
  </xs:restriction>
</xs:simpleType>

Cover photo by Banter Snaps

Tip #1244: CDS connector may not fire in administration mode

We did recommend using CDS Connector in Flow (more than once, actually) and most of the time it works great. However there have been some reports that CDS Connector does not trigger in the sandbox organizations while working fine in production. Turns out, there is a good explanation, straight from the source:

With the new CDS Connector … the events are pushed to Flow/Logic Apps by the async server. The async processing … [is] turned off for custom logic due to the organizations being in “Admin Mode.”

The source

Here we go. If CDS Connector does not fire as expected in your Flows, check if your organization is in administration mode.

Cover photo by unsplash-logoKristina Flour

Tip #1243: Forgot to turn off the Flow

Whoever decided that you shouldn’t be able to save a Flow in a solution if you haven’t turned it off first is a cruel, cruel person

Save me please

In case you haven’t head, you can add Microsoft Flow to solutions now (yay!) but if you edit a flow without first turning the Flow off, you will see the following error:

This is one of those moments where you may be tempted to utter the expletive of your choice in frustration, especially if you have made extensive change.

But fret not, all is not lost.

Simply right click on the browser tab and select “duplicate.” Then in the newly opened copy of your flow, go to the information screen, where you can turn off your Flow, then toggle back to the original tab and save your Flow.

Thanks MVP Natraj Yegnaraman for saving my Flow. Got any tips? send them to jar@crmtipoftheday.com.

Did you know that Tippy has a podcast?

You can now listen to us read and elaborate on the weekly tips of the day on the Power Platform Tip Show. Subscribe on Apple or Google podcasts, or catch us on the CRM Audio feed.

Cover photo by unsplash-logoChris Gallagher