Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Create Work Order in Power Automate trouble

  • 1.  Create Work Order in Power Automate trouble

    Posted 15 days ago
    Edited by Chris Bishop 15 days ago
    #CDS #PowerAutomate(Flow) I am trying to create a new work order to perform PowerAutomate actions on. When I use the Create New Record (CDS), there is a required field called Work Order number. In Dynamics, this appears to be auto-numbered so I'm not sure how to auto fill this field. Does anyone have a solution to get around this?



    ------------------------------
    Chris Bishop
    Consultant
    Bishop Technology Consulting
    ------------------------------
    ​​
    Academy - Online Interactive Learning from Experts


  • 2.  RE: Create Work Order in Power Automate trouble

    GOLD CONTRIBUTOR
    Posted 15 days ago
    Edited by Doug Apicella 15 days ago
    Hey Chris if the work order number truly is set up to be a autonumber for field service then you could simply set the field requirement to optional. When creating a new workorder the field is locked and auto generated for you either way. Do so will remove the requirement in the flow and since the auto number is a plugin it should still populate accordingly.

    If setting field requirement to optional isn't an option you could always get a list of work orders sorted by work order number and set the top count to "1" so it only pulls the top record which would in theory be the latest work order number. You could then get that value and increment it by 1 using a variable to populate that field on the workorder.

    On a side note you should try to use the Common Data Service (current environment) connector instead of the basic Common Data Service connector as there is talk that it is being deprecated. This will also help as you deploy through your environments you will not need to specify the environment every time.

    Thanks and keep me posted on how you resolve this. Thanks!

    ------------------------------
    Doug Apicella
    Solution Architect
    Hitachi Solutions
    SC
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 3.  RE: Create Work Order in Power Automate trouble

    Posted 15 days ago
    Hi Doug,
    Thanks for the response. The WO number field is left as is OOB. It increments in Dynamics so I was assuming it was auto-numbered like Cases or Orders might be. I'll set that up as an auto-numberer and try from there.

    I've tried the top count and order by 'createdon' to ensure the record. My challenge with that solution is that the resulting record is set as an array (list), even if it's an array of one, and I can't surface the entity attributes to apply to further steps.

    Thanks for the heads up on the CDS connectors.

    ------------------------------
    Chris Bishop
    Consultant
    Bishop Technology Consulting
    ------------------------------

    Academy - Online Interactive Learning from Experts


  • 4.  RE: Create Work Order in Power Automate trouble

    GOLD CONTRIBUTOR
    Posted 15 days ago

    Chris to get the items out of the array it would look like this:



    You'd still use an apply to each but since you're only returning 1 record, you can then use the compose function. You may have to do some cleanup of the string or extract just the order number out of the string but this would be the way to see the data. Thanks.


    ------------------------------
    Doug Apicella
    Solution Architect
    Hitachi Solutions
    SC
    ------------------------------

    Academy - Online Interactive Learning from Experts


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