Categories: Microsoft Office 365

Expected String but got Null, when calling a flow from a Model Driven app

A few weeks ago I looked at calling flows from model driven apps. And for a while my flow worked as expected and then suddenly it broke with an “Expected String but got Null” message

Calling a flow from a Model driven app

When you call a flow from a model driven app you would normally expect to see a dialog with a Run flow button.

In the past this worked as expected but recently I got the Something went wrong. please refresh the page or try again after some time.

Well, you can wait for a while, but this isn’t going to fix itself.

As you scroll down the dialog you will find the details of the error. in my case i got :

Error: The input body for the trigger ‘manual’ of type Request did not match its schema definition. Error details: ‘Invalid type. Expected String but got Null , invalid type Expected String but got Null

That still doesn’t mean very much!

Something is wrong with he trigger and something is wrong with the data in the trigger.

ok, what should we do to fix this issue.

Expected String but got Null workaround

Hopefully Microsoft will fix the real issue soon, but in the meanwhile I fot a good workaround. Hopefully this will help some other people. As it can be very painful when you run into this issue. It will simply be impossible to run the flows from your Model driven app without getting the Expected String but got Null.

My flow start with a When a record is selected trigger.

Then in the rest of the flow I was using information returned by this trigger. These references to the trigger are the causes of the problem.

So we have to avoid those. There is however one field that we can reference and that is the opportunity id. Any other properties that we reference might mean that the schema ( the shape of the data that is sent between the Model-driven app and the flow) might change. You adding another reference to a different field may change this schema.

To avoid this, we can use a get a record action.

In the get a record action we reference the opportunity. and now in any of the following steps we can only use dynamics data from this Get a record action rather than from the trigger.

Both the trigger and the get a record action will return exactly the same data anyway. So other than one maybe unnecessary extra call to the database, there isn’t too much of a disadvantage of using this method.

Share
Pieter Veenstra

Business Applications and Office Apps & Services Microsoft MVP working as a Microsoft Productivity Principal Consultant at HybrIT Services. You can contact me using contact@veenstra.me.uk.

Recent Posts

Create a Microsoft Teams team template

Recently I was asked about creating a team template in Microsoft Teams and apply this…

1 week ago

Who is in the office tomorrow, using Power Automate?

Do you want to know who is in the office tomorrow or the day after?…

2 weeks ago

8 top reasons to use Dataverse or SharePoint lists in the Power Platform

Why would you use Dataverse, if SharePoint lists gives you the option to avoid premium…

4 weeks ago

Filter by calculated fields in SharePoint using Power Automate

When you read items from a SharePoint list and you want to filter by calculated…

4 weeks ago

Get all your broken connections using Power Automate

To get all your broken connections in the Power Platform can be a challenge. In…

1 month ago

Customer Voice a.k.a. Forms Pro the database behind the magic

If you call Customer Voice still Forms Pro or not, have you ever looked into…

1 month ago
%%footer%%