cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenDonahue
Skilled Sharer
Skilled Sharer

Create a case in D365 using either Dynamics or Common Data Service connector in Power Automate

 

 

Attempting to create a new case in out Dynamics 365 Sandbox, I have tried to use the template, "Create a new record in Dynamics 365 on Microsoft Forms submission." In the block, "Create a new record" that is using a Dynamics integration, I get the error, "

Bad Request - Error in query syntax." 
 
Here is my block:
 
 

 

d365CaseCreationFail1of2.png
d365CaseCreationFail2of2.png

 

My first instinct is that the Owner is of data type, "Owner" which is a record. If this is the issue, how can I access the user's record? I tried Get Record and using the body of that, but to no avail.

Thank you for your help in this; it is greatly appreciated.

21 REPLIES 21
GarryPope
Impactful Individual
Impactful Individual

Hello @BenDonahue,

Thanks for the reply.

If you type Common into the search box you'll see two connectors called Common Data Service, but one will be Common Data Servi... this is the one you want, as it's the Common Data Service (current environment). It's confusing, I know. But the Common Data Service is the older connector and the Common Data Servi... is the newer connector. See screenshot below. 

 

CDS CE.png Thanks,

Garry

BenDonahue
Skilled Sharer
Skilled Sharer

Unfortunately, that does not happen on my end:

BenDonahue_0-1614173434698.png

 And with "list records:"

BenDonahue_1-1614173558589.png

Switching to Premium filter:

BenDonahue_2-1614173607089.png

This is all very curious. I am beginning to think that this is less of a "Ben" issue than it is a "Microsoft" issue.

What are you thoughts? Open a ticket?

GarryPope
Impactful Individual
Impactful Individual

Hello @BenDonahue,

Thanks for the screenshots, yes, that's odd. I've never seen that before.

Raise a ticket and see what Microsoft say. 

Thanks,

Garry

 

BenDonahue
Skilled Sharer
Skilled Sharer

I did yesterday and will have an a talk with a support rep later today.

 

This is how it seems to go with me; what is supposed to be the hard part, specifically working with new concepts and creatively and securely implementing them, like grabbing code generated from Advanced Search and placing it in a uniquely functional block, abstracting it to be usable in a dynamic sense, ends up being the easy part, while finding the block to click is the hard part requiring, 4 professionals to solve, IF it gets solved by the first support rep.

 

I want to thank you again for all your help. You have, I believe, given me the tool I need to address this, and many future, problems, and will be certain to award you with the solution when it works.

 

Presumably, when I am able to click the block, I'll reference the instructions you posted along with the information in the link, get the thing to work, award the solution and move on to the next challenge. Meh, I'm feeling lucky today, so we should be good. 🙂

BenDonahue
Skilled Sharer
Skilled Sharer

@GarryPope  ,

After rambling on below, I finally have the question I believe I need answered; let me provide it here, so you don't have to read all that:

What is the value I want to have on the Customer line, please? It is a complex value, being the record for the user.

 

If you're still with me, please know that I can't thank you enough for all the help you have already provided, much less any you might yet provide.

 

Good news,/Bad News

First

The Good News:

 

My problem is that I was trying to create a Flow from within My Flows. For some reason, this is bad, as Common Data Service (current environment) is not available to Flows created from within My Flows, but only to Flows created from with a Solution. So, I created a solution and created the Flow there. That got me moving right along. One "Gotcha" moment came in copying and pasting the fetch code from Advanced Search; I had to remove the dashes from in front of the parent lines. That done, the block worked perfectly; I created the List Rows block and added the Fetch XML code copied from Advanced Search, replacing the email address with the dynamic content Responder's Email.

Snag_7365e78.png

 

moving right along, that is, until...

 

The Bad News: 

 

Create a row happened. That is proving troublesome. it doesn't seem to like the values I am supplying for much of anything, but let's start with Customer. I'm using this in the block: 

Snag_736e06a.png

 

Where User is the GUID. I get, another other information, this error message: 

 

 "message": "Creating Entity with an invalid parent. Entity: Incident, ReferencingAttribute:customerid"

 

Prepending a slash to sustemusers, gets me this error message:

 

  "@Microsoft.PowerApps.CDS.InnerError.Message": "Creating Entity with an invalid parent. Entity: Incident, ReferencingAttribute:customerid"

 

What is the value I want to have on the Customer line please?

GarryPope
Impactful Individual
Impactful Individual

Hello @BenDonahue,

Mate, I can't believe I missed that with the Common Data Service (current environment). I always create my Flows in solutions, hence why I missed it. Sorry.

 

Okay. So your question...

I don't believe you'll be able to populate the Customer (Contacts) column with the values from the User table.   

Here is the Microsoft Docs on the data type Customer column.

 

In the Customer (Contacts) field you'll want to pass the GUID of the Contact not the User.

If I remember rightly, when the person completes the Microsoft Forms form you get their email address. And all those people are Contacts in your Dataverse environment.

So if you just do the same as we did for Users, but use Contact instead, you'll then be able to get GUID column for the Contact, which is contactid then pass that into the Customer (Contacts) column on your Case.

 

I haven't tested this though. It's a bit difficult to explain, but I hope that makes sense?

Garry

 

View solution in original post

BenDonahue
Skilled Sharer
Skilled Sharer

I don't believe there is any documentation stating the connectors available in Solutions are not available in My Flow. Best Practices, it would seem, is never to use My Flows.

I posted my next new, fun and interesting issue, and tagged you in it.

Honestly, at this point, I actually hope it is me this time, like, missing a comma, environment mis-match, something that speaks to the stability of this platform, and makes me a better developer.

I can't believe I'm the first person to ever want to make a form to create a row in Case, but it might just be so. Now, at least, there will be a roadmap for anyone following me, with your name and help integral in it's creation.

(Grats Continued Contributor, btw) 

And with that last piece of the puzzle you helped with on the other question, I am over the finish line. You have been very generous with your time and help. I look forward to the opportunity to give you assistance with a problem eventually, however unlikely that may be.

If you want to copy that solution over to here, to finish out this question, I'll award it the solution.

You're the best, @GarryPope!

GarryPope
Impactful Individual
Impactful Individual

Hello @BenDonahue,

Happy to help. Just ask if you have any other questions in the future. 

Have a good one!

Garry 

Awesome. 

Do you want to copy your solution to the other stand alone question over to this thread as it wraps up the whole thing?

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
Users online (1,264)