cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CRMPowerapps
Helper II
Helper II

Edit code in Flow

Hello, 

 

Im having issues with my trigger in a flow i have built for our D365 Sales. When I try to run the flow i get this error:

"Error: The input body for trigger 'manual' of type 'Request' did not match its schema definition. Error details: 'Invalid type. Expected String but got Null.'. flow"

 

And when I go in to my flow there is an error with the trigger, I select "fix the trigger" and I can see the code of the trigger where the issue is.

 

It looks like this:

 

 "type""object",
  "properties": {
    "rows": {
      "type""array",
      "items": {
        "type""object",
        "properties": {
          "entity": {
            "type""object",
            "properties": {
              "_transactioncurrencyid_value": {
                "title""Currency",
                "type""string",
                "format""guid"
              },
              "listname": {
                "title""Name",
                "type""string"
              }
            },
            "required": []
          },
          "boolean": {
            "title""Yes/No",
            "type""boolean",
            "x-ms-dynamically-added"true,
            "description""yes",
            "x-ms-content-hint""BOOLEAN"
          }
        },
        "required": []
      }
    }
  },
  "required": []
}
 

From the error message I can understand that the type is String but got null, so my question is. Could it be just that easy to add "Null" as type? But how to I do it? I can not find a way to edit the code?

 

BR, 

Emma

1 ACCEPTED SOLUTION

Accepted Solutions

 

Hi @CRMPowerapps ,

 

Please follow up this thread:

https://community.dynamics.com/365/sales/f/dynamics-365-for-sales-forum/385979/bulk-create-custom-ac...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
v-bacao-msft
Community Support
Community Support

 

Hi @CRMPowerapps ,

 

Could you share the screenshot of the trigger configuration?

If you have not configured the trigger and you want to edit the peek code of the trigger, I am afraid that we could not do this operation. Peek code only can be used to view the details of the request and we could not modify it.

Please check this link to get more details about peek code:

https://docs.microsoft.com/en-us/business-applications-release-notes/october18/microsoft-flow/peek-c...

 

An alternative workaround to solve the issue you encountered, you could export this flow as .zip file and edit the JSON in this file.

Then import this file again as a new flow. Please check the following thread:

https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-edit-code-in-Microsoft-Flow/td-p/3...

 

You could refer to this article to add type:

https://blog.thenetw.org/2019/03/11/quick-fix-microsoft-flow-error-invalid-type-expected-string-but-...

 

Hope this helps.

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @v-bacao-msft 

 

I managed to run now it but it gets stuck after the first two steps. It runs, 0 seconds on each then stops...

 

My flow looks like this:

1. when a record is selected (marketinglist)

2. list records (listmembers)

3. apply to each (output: Value)

3.1 List records 2 ( Accounts)

4. apply to each 2 (output: value)

4.1 Create a new record (opportunity)

 

Thanks in advance!

 

Hi @CRMPowerapps ,

 

Please follow up this thread:

https://community.dynamics.com/365/sales/f/dynamics-365-for-sales-forum/385979/bulk-create-custom-ac...

 

Best Regards,

Community Support Team _ Barry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful
Resolver III
Resolver III

I ran into this error recently and thought I'd add my observation since the content of the thread didn't get me what I needed.

 

Scenario: Allow a user to run an on-demand Flow from a model-driven app. Let's say the entity is "Foo" with two attributes:  "Name" and "Description"

 

I created a flow with the "When a record is selected" trigger and added an action that relied on the Foo.Description attribute. When I ran the Flow it failed with the error above.

 

After staring at it for a long time I realized that only the attributes that are displayed in the view that the user is selecting the record from are available at execution time. Basically, Description was not in the view so I added it and it worked. Of course, I didn't really want Description in the view so I simply added a "Get record" action after the trigger to get me the attributes I needed.

 

Hope this helps someone out there.

@Helpful -- BRILLIANT!! Thanks very much for the perfect solution -- you saved us much (more) frustration. Thanks, too, for taking the time to track back to the post and add your comment.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (1,270)