Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Create Record using Azure Logic App

  • 1.  Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 01, 2019 07:08 AM

    Dear All,

     

    We are currently working on Azure Logic apps and looking forward to create some records in CRM.

    Now we used the connector for Dynamics 365 and pointed to organization and got the entity.

     

    Now when we try to enter data into the fields it somehow ends of giving up an error message

     

    An error occurred while validating input parameters: Microsoft.OData.ODataException: Does not support untyped value in non-open type.\r\n at System.Web.OData.Formatter.Deserialization.DeserializationHelpers.ApplyProperty(ODataProperty property, IEdmStructuredTypeReference resourceType, Object resource,

     

    Having checked into the error it tells that some of the input values provided are not proper.

     

    Could anyone guide as to how we should enter data in the below field types

     

    We are looking to populate 4 different fieldtypes

     

    Currency - This should hold 'US Dollar'

    Potential Client - Name of Company

    Potential Client Type - accounts in our scenario

    Probability - This is an option set field

    Summary - This is a simple text field

     

    Thank you for your help.




    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------


  • 2.  RE: Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 01, 2019 08:49 AM
    Below is the screenshot of how I am entering the data in the fields

    screen


    still no luck . Need help on the same

    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------



  • 3.  RE: Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 04, 2019 08:08 AM
    Bumping the discussion thread .. can anyone help?

    Thank you ​

    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------



  • 4.  RE: Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 04, 2019 09:25 AM
    I'm not able to help but I'm interested in your solution.

    I haven't yet seen functions run inline besides the built in 'Expressions' so I'm interested to know how these work.
    DateTimeOffset.Parse()

    (here are a list of date time expressions)


    As for these inline function I haven't seen these work either so I'd handle them a little different.
    accounts()
    transactioncurrencies()

    What I would do is do a dynamics action 'GetRecord' of the transaction currency and a dynamics action 'GetRecord' of the account prior to creating the record.  Use the results of those first two actions to save into the Create a new record action.

    There are a couple different things that I would try when debugging though.
    On your error run you should be able to see an exclamation point and a 'show raw inputs'

    This should at least show you the odata that is attempted to be processed.  You may recognize the error in that.

    Logic Apps have been a lot of trial and error and I haven't seen a lot of great examples out there so it would be great if you could share any insights when you finish.  Thanks!

    ------------------------------
    Travis Judd
    CRM Developer
    Trek Bicycle Corporation
    WATERLOO WI
    ------------------------------



  • 5.  RE: Create Record using Azure Logic App

    SILVER CONTRIBUTOR
    Posted Mar 04, 2019 10:27 AM
    You've made it way too hard for yourself. All you need is the guids in the Currency/Potential Customer fields. The date needs to be in yyyy-mm-dd format. The below worked for me.



    ------------------------------
    Ben Bartle
    IBM
    ------------------------------



  • 6.  RE: Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 05, 2019 05:42 AM
    Thank you @Ben Bartle,

    This is great I was able to get the opportunity created :-) .
    Thinking about extending it further is there a way available to dynamically pass values to the logic app using web api

    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------



  • 7.  RE: Create Record using Azure Logic App

    Posted Mar 05, 2019 09:37 AM
    Something that I have found useful is to realize that behind the scenes LogicApps is using XRM WebAPI. What this means is that you can figure out the parameters using CRM Rest Builder. And to figure out the parameters, like TransactionCurrency, you can run the RetrieveMultiple and get the values that way.

    Regarding your question about passing parameters to your logicApp, it depends on how you are invoking your LA. If its a HTTP trigger, you can pass values to it, using queryParameters. I wrote a quick post about it: LogicApp-HttpRequest trigger: retrieving query parameters (and more documentation: Call, trigger, or nest workflows with HTTP endpoints - Azure Logic Apps). But just some other ideas, you could trigger the LA using storage queues or Azure Service Bus, where the message contains the data needed to trigger the app.

    ------------------------------
    Raj Rao
    National CineMedia
    Centennial CO
    ------------------------------



  • 8.  RE: Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 06, 2019 07:09 AM
    hello @Raj Rao,

    Thank you so much for sharing the details.
    I have installed the solution in my test environment and will look forward to work through it.

    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------



  • 9.  RE: Create Record using Azure Logic App

    Posted Mar 07, 2019 07:32 PM
    Another alternative way we can do this is by using Get Data from Dynamics before we create the opportunity and populate any lookup value


    You can populate using pre-fetched data in the create record. And also you can use the dynamic value from the fetched account

    Result

    Hope that helps!

    ------------------------------
    Aylwin Wijaya

    ------------------------------



  • 10.  RE: Create Record using Azure Logic App

    GOLD CONTRIBUTOR
    Posted Mar 12, 2019 07:17 AM
    Hello @Aylwin Wijaya ,

    Thank you for your reply.
    Yes this is something i have learnt. the logic apps and Microsoft ​flow seem to work alike.
    if any data is needed in the next step then we will need to fetch the data in the previous step. I was able to work through this by specifying the Variables for the fields in the JSON body of the HTTPS request header .

    ------------------------------
    Bhartendu Pandey
    Willis Towers Watson
    London
    ------------------------------



If you've found this thread useful, dive deeper into User Group community content by role