cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ayy8
Level: Powered On

Add contact to marketing list using Perform an Unbound Action

Anyone have any experience with using the Perform and Unbound Action action in the cds connector? https://docs.microsoft.com/en-us/connectors/commondataserviceforapps/#perform-an-unbound-action

Tried to construct an action to add a contact to a marketing list but receiving some errors. Anyone have success with creating the query?

Inputs:

 

{
  "host": {
    "apiId": "***",
    "connectionReferenceName": "shared_commondataserviceforapps",
    "operationId": "PerformUnboundAction"
  },
  "parameters": {
    "actionName": "AddListMembersList",
    "item/List/listid": "1099c99b-6e06-ea11-a811-000d3a795fed",
    "item/Members": [
      {
        "contactid": "1dd9cc96-a4f7-e911-a813-000d3a794392",
        "@odata.type": "Microsoft.Dynamics.CRM.contact"
      }
    ]
  }
}

 

 Outputs:

 

{
  "statusCode": 400,
  "headers": {
    "Cache-Control": "no-cache",
    "Set-Cookie": "",
    "Server": "",
    "x-ms-service-request-id": "",
    "Strict-Transport-Security": "max-age=31536000",
    "REQ_ID": ",",
    "AuthActivityId": "",
    "x-ms-ratelimit-burst-remaining-xrm-requests": "5998",
    "x-ms-ratelimit-time-remaining-xrm-requests": "1,199.92",
    "OData-Version": "4.0",
    "X-Source": "25097213227865284231156169119942302191521281982142522006411489022222625420722522787171",
    "Public": "OPTIONS,GET,HEAD,POST",
    "Timing-Allow-Origin": "*",
    "Date": "Thu, 14 Nov 2019 02:45:08 GMT",
    "Content-Length": "5156",
    "Allow": "OPTIONS,GET,HEAD,POST",
    "Content-Type": "application/json; odata.metadata=minimal",
    "Expires": "-1"
  },
  "body": {
    "error": {
      "code": "0x0",
      "message": "An error occurred while validating input parameters: System.FormatException: Input string was not in a correct format.\r\n   at System.Text.StringBuilder.FormatError()\r\n   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)\r\n   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)\r\n   at System.String.Format(IFormatProvider provider, String format, Object[] args)\r\n   at Microsoft.Crm.CrmHttpException..ctor(HttpStatusCode statusCode, String message, Object[] args)\r\n   at Microsoft.Crm.Extensibility.OData.CrmEdmEntityReference.CreateCrmEdmEntityReference(Uri link, IEdmModel edmModel, CrmODataExecutionContext context, EntitySetSegment& entitySetSegment)\r\n   at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitiveData(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, CrmEdmEntityObject& result)\r\n   at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitives(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, EdmEntityObjectCollection& result)\r\n   at Microsoft.Crm.Extensibility.ODataV4.CrmODataActionPayloadDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)\r\n   at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)",
      "innererror": {
        "message": "An error occurred while validating input parameters: System.FormatException: Input string was not in a correct format.\r\n   at System.Text.StringBuilder.FormatError()\r\n   at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)\r\n   at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)\r\n   at System.String.Format(IFormatProvider provider, String format, Object[] args)\r\n   at Microsoft.Crm.CrmHttpException..ctor(HttpStatusCode statusCode, String message, Object[] args)\r\n   at Microsoft.Crm.Extensibility.OData.CrmEdmEntityReference.CreateCrmEdmEntityReference(Uri link, IEdmModel edmModel, CrmODataExecutionContext context, EntitySetSegment& entitySetSegment)\r\n   at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitiveData(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, CrmEdmEntityObject& result)\r\n   at Microsoft.Crm.Extensibility.ODataV4.ODataParameterReaderExtensions.TryReadFlowPrimitives(ODataParameterReader oDataParameterReader, ODataDeserializerContext readContext, EdmEntityObjectCollection& result)\r\n   at Microsoft.Crm.Extensibility.ODataV4.CrmODataActionPayloadDeserializer.Read(ODataMessageReader messageReader, Type type, ODataDeserializerContext readContext)\r\n   at System.Web.OData.Formatter.ODataMediaTypeFormatter.ReadFromStream(Type type, Stream readStream, HttpContent content, IFormatterLogger formatterLogger)",
        "type": "Microsoft.Crm.CrmHttpException",
        "stacktrace": "   at Microsoft.Crm.Extensibility.OData.CrmODataUtilities.ValidateInputParameters(ModelStateDictionary controllerModelState)\r\n   at Microsoft.Crm.Extensibility.OData.ActionController.<>c__DisplayClass9_0.<PostUnboundAction>b__0()\r\n   at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties)\r\n   at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func)\r\n   at lambda_method(Closure , Object , Object[] )\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n   at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext()"
      }
    }
  }
}

 

2 REPLIES 2
Community Support Team
Community Support Team

Re: Add contact to marketing list using Perform an Unbound Action

Hello ayy8,

 

Would it be possible for you to share with us a screenshot of the values you are inputting in the Perform a Bound action card?

How exactly are you entering the user value?

 

Best regards,

Ana Mateus

Support Engineer

Power Platform

ayy8
Level: Powered On

Re: Add contact to marketing list using Perform an Unbound Action

Just wanted to share the flow with everyone after several hours of trial and error with Microsoft Flow. How to use microsoft flow to add and remove members to a static marketing list.

To add a record to the marketing list, use the Common Data Service (Current Environment) connector and select "Perform a bound action".

In the details of your bound action: There might be a long delay for the flow connector to retrieve a list of the actions. Be patient!
There is no need to surround brackets around the guid. i.e. contacts(guid_value)

Entity Name: marketing lists
Action Name: AddMemberList
Item ID: GUID of marketing list
EntityId: Guid of contact value

To remove a record from the marketing list, use the Common Data Service (Current Environment) connector and select "Perform a bound action".
In the details of your bound action:

Entity Name: marketing lists
Action Name: RemoveMemberList
Item ID: GUID of marketing list
EntityId: Guid of contact value

Helpful resources

Announcements
firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

firstImage

Incoming: New and improved badges!

We've given our badges an overhaul and also added some brand new ones!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Power Automate Community Video Gallery!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,238)