“When a record is selected” trigger error in Power Automate

Posted by

“When a record is selected” trigger is a wonderful things that allows you to run flows on one or several records as selected by a user. In addition to that, these flows also run in that user’s context – so all connections would be established under that user.

However, in some scenarios, when I tried to run the flow on some records I got this not particularly helpful error. As you may guessed, “try again after some time” didn’t help. This flow didn’t run, so it failed before then.

So, the trick that worked for some other places across Power Platform is to look under the hood, in the browser console. Just open your “Developer tools” or inspect the page and look into browser’s console messages. You can see something like this:

As you can see, in my case the hint was in the message “Expected String but got Null”. Apparently, the “When a record is selected” trigger defines a schema with some fields of the record and expect them to be all mandatory. It turned out that some records had Null values in the fields expected by the trigger to be populated. When I fixed the data, all worked smoothly.

P.S. I appreciate if you point me to the place where it explains how that schema of the trigger “When a record is selected” is defined and how can I make optional fields not expected by the trigger to be populated.

4 comments

    1. Thank you, Frank! This is a great tip. It seems though, one cannot export/import flow that is solution-based. I think that if the whole solution is exported and imported this can work. Will try next time!

      Like

  1. I saw on another blog post (Forgot where, so I cannot give credit due), that if you add a second step to you flow where you use the new Dataverse connection to “get a row by id”, and retrieve the selected record, and then use that step for all following steps in stead of the trigger-step, then everything works fine, since the trigger step only assumes the recordid in the schema.

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s