Hello everyone,
I am trying to send an email from a Flow by using the Common Data Service (Current Environment) Unbound Action SendEmailFromTemplate. I worked through all the other snags (except for attachments) and I can generate the email by using Postman to connect to the WebApi, but as soon as I try and use the connector in Flow, I get a string error.
The only thing that I changed between the body I used in Postman, and the action in Flow, is to double escape the '@' in the Target object by adding another '@', otherwise Flow can't save because it tries to evaluate odata. (ERROR: Unable to parse template language expression 'odata.type': expected token 'LeftParenthesis' and actual 'Dot')
"@@odata.type": "Microsoft.Dynamics.CRM.email"
If I use Common Data Service (Current Environment) Unbound Action SendEmailFromTemplate in Flow, I get the following error:
An error occurred while validating input parameters: System.FormatException: Input string was not in a correct format.
at System.Text.StringBuilder.FormatError()
at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)
at System.String.Format(IFormatProvider provider, String format, Object[] args)
at Microsoft.Crm.CrmHttpException..ctor(HttpStatusCode statusCode, String message, Object[] args)
at Microsoft.Crm.Extensibility.OData.CrmEdmEntityReference.CreateCrmEdmEntityReference(Uri link, IEdmModel edmModel, CrmODataExecutionContext context, EntitySetSegment& entitySetSegment)
at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitiveData(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, CrmEdmEntityObject& result)
at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitive(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, CrmEdmEntityObject& result)
at Microsoft.Crm.Extensibility.ODataV4.CrmODataActionPayloadDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)
at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)
Below is the JSON I am using in Regarding and Target:
{
"contactid": "B8fe2ee9-9f33-ea11-a813-000d3a24c29d",
"@odata.type": "Microsoft.Dynamics.CRM.contact"
}
{
"subject": "",
"description": "",
"regardingobjectid_contact@odata.bind": "/contacts(b8fe2ee9-9f33-ea11-a813-000d3a24c29d)",
"email_activity_parties": [{
"partyid_systemuser@odata.bind": "/systemusers(fba8443b-6365-4ade-ab81-abe6c47cba3b)",
"participationtypemask": 1
}, {
"partyid_contact@odata.bind": "/contacts(b8fe2ee9-9f33-ea11-a813-000d3a24c29d)",
"participationtypemask": 2
}],
"@@odata.type": "Microsoft.Dynamics.CRM.email"
}
It almost feels like the connector isn't handing the properties correctly. If you look at the Flow run result, the Regarding object doesn't seem to render to JSON, and Flow also doesn't complain if I don't double escape the '@' before odata so the object isn't set as JSON, BUT the API is reading the data in regarding because if I remove the data from Regarding, the API comes back and says that is requires Regarding to be specified.
Any ideas would be appreciated.
Have a great day!

Report
All responses (
Answers (