Tip #1384: Inline Code in Power Automate

I finally found some courage to publish a video tip of my own. Why now? Because the topic is just too good to simply write it down. You have to see it! What is it? It’s JavaScript code inside Power Automate – yes, we can!

Watch this video to learn how to build the simplest possible Azure Function that will bring inline code execution to your flows! The possibilities are endless – regular expressions, recursive functions, math operations, and much more.

WATCH VIDEO

Tip #1383: Fire and forget flows

When you fire up a child workflow in classic workflow, it’s always asynchronous. Fire and forget. Sometimes it’s what you need, sometimes you want to insist on child finishing their greens before the dessert, so to speak.

Power Automate, on the other hand, always wants the result when you call a child flow and nags you about it:

But what if you don’t want to wait? What if you want start a child flow but really don’t care about the result?

Output action (either Respond to a PowerApp or flow or Response) is usually the last one in the child flow, kind of a return statement. But it does not have to be – you can include this action as one of the first steps in the child flow. You can even add the output in case you need to tell your parent something like “I’m going to get some milk, back in 3 days”.

The child will execute that respond action and move onto the subsequent steps as if nothing has happened. Everyone’s happy.

Cover image Fire and forget missile / CC BY-SA

Tip #1382: Build a bot with Power Virtual Agents in less than 10 minutes

I always wanted to have a boat. But you know what they say: there are two happy days in the life of every boat owner – the day they bought the boat and the day they sold it. Ah, you meant BOT? Oops… Well, same story, as it turned out, kind of “meet the creator” moment.

In this video, Derik will walk you through the process of creating a chat boat bot with Power Virtual Agents.

Watch the video

Tip #1381: Fixed reference entity in Power Automate

Need to reference a fixed record, for example, Accounts Payables, or SARS-CoV-2? Challenge with fixed records is that we have no idea what the record identifier is, how to reliably search for the record and how to pass it as a parameter between environments.

Why not to use a fixed guid and create that entity when needed?

  1. Goto https://www.guidgenerator.com/ or any other guid generator of your choice.
  2. Generate a new guid. Don’t worry about duplicate detection. You have not seen that guid before, trust me.
  3. Get the record you’re after using that guid
    • restrict the attributes to what you need; if checking for the record presence and nothing else, put in just the primary key entitynameid.
  4. Create that record if failed
    • configure create action to run on fail
    • set record id to that guid you’ve created earlier
  5. Now you can safely use the reference in lookups etc.

Something like this:

Cover photo by Thorn Yang from Pexels

Tip #1379: App People vs. Flow People

The wand picks the wizard

Nick Doelman

Too tired to read? Why wouldn’t you listen instead – t.j.

It’s been my observation that with a few notable exceptions, people in the Power Platform community primarily focus on Power Apps or on Power Automate. Lots of people will use both, but generally people are more “app people” or “flow people.”

I don’t have a strong preference between the two, and I regularly use and enjoy both platforms, but I’ve had conversations with people in the community that say something along the following lines:

Flow Person: “I love Power Automate, but Power Apps (canvas apps) are confusing.”

Apps Person: “I can write canvas apps all day long but you need to be a developer to use Power Automate.”

I’ve also noticed that if you suggest a flow solution in the Power Apps forum or an app solution in the Power Automate forum at powerusers.microsoft.com, people will give you funny looks.

Intrigued by this phenomenon, I interviewed some of my friends in the Business Applications community to see what they thought was behind this divide. Why does one tool seem accessible and easy to some while difficult to others?

Continue reading

Tip #1378: Update Common Data Service user photo from Office 365 profile

I had things stolen from me, I gave things away on many occasions. But I never ever lost anything. What’s the secret? Time perception.

I do not lose things, I only temporarily misplace them

The Enabler

Consider this. Last year I created a folder for all the good tips coming in from the fellow tipsters, users, developers. (Your email can land in that folder too if you send it to jar@crmtipoftheday.com). Then I lost misplaced that folder. Then I found it again (SEE?). For the next few days I’m going to be bringing these tips to life. Today’s tip is from Michael Aarvik.

Continue reading

Tip #1377: Open Advanced Find in tab

I truly hope that one of the traits that differentiate me from, say, an ungrateful baboon, is ability to recognise when I’m wrong and apologise to Jeff Klosinski who sent not one but two tips an EFFING YEAR AGO and I haven’t published it.

In my defense I couldn’t reproduce either. But you know how can you tell a good tip? It stands the test of time. Today I went back, played a bit and discovered that when combined, those two tips just like sodium and water produce kapow! of one powerful trick.

Continue reading

Tip #1376: Antivirus for portal attachments

One taketh one giveth (or other way around). Returning a favor to AK who asked:

How does the portals handle uploading of virus?

(Want your favor returned? Send your awesome tip to jar@crmtipoftheday.com!)

There are multiple mechanisms you can put in place to protect your users from the viruses (no, not that virus, unfortunately).

Continue reading

Tip #1375: Get record count for entities

I need to perform some data… uhm… “augmentation”. Easy as using Power Automate – get all the records, loop through, fudge I mean augment the data. Right? Except there could be more than 100,000 records. Why 100K? That’s the maximum you can get with the List Records action. (Wanted to insert a reference here but that limit does not seem to be documented at all… Oh, well, save it for another tip). In short: I need quickly to find out the total number of records in couple entities. On top of that, those were the entities not exposed outside of their parent entities, like Order Product or Invoice Product.

Even if you are not a developer there are couple Web API methods you can add to your toolbox and RetrieveTotalRecordCount function is one of them.

https://orgname.crmN.dynamics.com/api/data/v9.1/RetrieveTotalRecordCount(EntityNames=['logical_name_1','logical_name_2', ...])

for example:

https://foobar.crm.dynamics.com/api/data/v9.1/RetrieveTotalRecordCount(EntityNames=['salesorder','salesorderdetail','invoice','invoicedetail'])

This is what comes back:

{
  "@odata.context": "https://foobar.crm.dynamics.com/api/data/v9.1/$metadata#Microsoft.Dynamics.CRM.RetrieveTotalRecordCountResponse",
  "EntityRecordCountCollection": {
    "Count": 4,
    "IsReadOnly": false,
    "Keys": [
      "salesorder",
      "salesorderdetail",
      "invoice",
      "invoicedetail"
    ],
    "Values": [
      6679,
      10547,
      17568,
      59618
    ]
  }
}

Nice and easy, right?

Cover photo by Amornthep Srina from Pexels.