I am attempting to turn an email into an appointment in Dynamics 365 (CRM). This is a scheduled appointment, so I want it to show in the user's calendar. I can successfully parse the email contents and create the appointment, but I cannot designate it as "Scheduled" (state code 3). The only options in flow are to set the statuscode.
When I run the flow without Statuscode, it works fine but the appointment is created as "Open", so it doesn't actually show in their calendar. By Default, creating an appointment in CRM seems to create it in a Scheduled state, so I was suprised this isn't the default from within Flow. However when I attempt to set the statuscode to "Busy" (5) in flow, I get the error:
5 is not a valid status code for state code AppointmentState.Open on appointment with Id 90a83cf7-f861-e911-a97e-000d3af497c0.
I also cannot seem to set the status after the appointment is created -- it's stuck on Open
Is there some other way to designate in flow that I need a scheduled appointment? Is there a way to set the value of fields that obviously exist, but aren't exposed through flow for some reason?
Any assistance is appreciated. I've tried everything I can think of and no luck on this one.
Hi @gwengreniuk ,
Could you please share a screenshot of your flow's configuration?
As the error message said, the code you have used in the flow is invalid.
I think I need more details to deal with your issue.
Community Support Team _ Zhongys
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Not sure that a screenshot will help as the issue is that you cannot (in flow) set the state code, only the status. CRM requires that both be set to compatible values (State is Open, Status is free -- State is Scheduled, Status is busy, and so on). Flow only has the ability to set the status value, and the error is indicating that it is not compatible with the state.
As it is, I was able to work around the issue by triggering the update from within CRM as a process instead of via Flow. CRM properly sets both fields at the same time, so the function works. Looks like a bug within Flow, so hopefully it gets resolved at some point and then that will eliminate a two-step update.
Thanks for the offer of assistance in any case.
The Dynamics connector allows you to access and update many items, it is just a more advanced way to doing so than most connectors because of the use of OData. See the official documentation's Specifiy advanced options secton for more information, and pay close attention to the best practices when using advanced options. Most of the power comes from the filter and order by queries that also allow you to Add dynamic content:
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. THANKS!
Thanks for the response on this, and I've used the filtering concepts with other applications where otherwise inaccessible fields were concerned, but I can't see how this allows me to *write* to a field that is not available in the interface. Maybe I'm missing something in the documentation you're linking, but the issue here is that I need to update a field which is not exposed through the connector in Flow, and Flow isn't automatically keeping statecode/statuscode in sync the way CRM's process workflow designer does.
Are you suggesting that I can update fields that aren't available in flow using this method?
We've updated and improved the layout and uploading format of the Power Automate Cookbook!
Fill out a quick form to claim your user group badge now!
We've given our badges an overhaul and also added some brand new ones!
Learn how to build the business apps that you need.
Find out where you can attend!
Watch & learn from the Power Automate Community Video Gallery!