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.

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

View Comments

  • Hi Pieter,
    I encountered the same issue today. But strangely my flow was somethimes working and sometimes giving the error you mentioned.

    When inspecting the trigger with 'peek code' it showed two field that it is using further down in the flow. So it looks like a automatic 'rollup' of all fields that are used.
    Unfortunatiely the fields are flagged as 'required'

    So that is why my flow sometimes works. As long as all field are filled, it works. I like it this way, because I need both fields.
    If one of them is optional, your workaround is great.

    • Most likely the sometimes working is down to the actual values in the data. When fields are not supplied they will be set to null and therefor without a datatype

Recent Posts

3 steps to implementing a better date picker in Power Apps

One of the biggest annoyances of Canvas Apps in Power apps is the date picker.…

3 days ago

Power Automate Flow run failed: Connection not configured for this service

Today I was battling with the Connection not configured for this service error. Background Iv'e…

3 weeks ago

Open Word documents in the desktop app from Power Apps

When you open Word documents from Power Apps you might have noticed that Word Online…

2 months ago

Introducing Portal Apps in Power Apps

Power Apps has three types of apps. One of them is the Portal app. In…

2 months ago

NEVER give your SharePoint fields the displayname of Value!

After an hour of banging my head against a brick wall when my Patch command…

2 months ago

Collect flow runs of your failed child flows

When you use child flows, you might need to collect the flow runs of your…

2 months ago