Customer Engagement & Dynamics CRM Forum

Expand all | Collapse all

Flow Embedded Connections, Child Flows, Solutions, and Sharepoint

  • 1.  Flow Embedded Connections, Child Flows, Solutions, and Sharepoint

    TOP CONTRIBUTOR
    Posted Dec 19, 2019 04:20 PM

    Has anybody managed to create flows that are able to combine these 3 requirements simultaneously:

    1) Solution Aware
    2) Parent Child Flows
    3) Interacts with Sharepont


    I'm currently working to replace workflows with flows. The current task is document location creation on sharepoint that fires upon record creation (IE before user clicks the document folder) and creates a different folder structure than what comes with the OOB dynamics integration. As it sits, I can create them in an isolated standalone flow outside of a solution / without parent/child flows, but haven't been do so within a solution as a child/parent flow (IE a creation handler with a child flow to create the doclocs.

    Initially I ran into errors, getting the "[flow] cannot be used as a child flow because child workflows only support embedded connections." After a little research, I determined it is because the CDS connectors do not use an embedded connection:
    https://powerusers.microsoft.com/t5/Building-Flows/Getting-error-calling-a-child-flow/td-p/430120
    The fix for this is to replace any of the CDS connectors with the "CDS(Current Environment)" connectors, which provide a number of other benefits, such as attribute filtering akin to what is offered by the plugin registration tool. Thumbs u!

    When attempting to create child flows to create sharepoint document locations, it appears there is not a sharepoint connector that utilizes an embedded connection. I'm guessing this is why sharepoint connections cannot be included in solutions (yet), per https://powerusers.microsoft.com/t5/Building-Flows/Getting-error-calling-a-child-flow/td-p/430120

    Any pointers?




    ------------------------------
    Ryan Perry
    Business Systems Analyst
    Auric Solar
    ------------------------------


  • 2.  RE: Flow Embedded Connections, Child Flows, Solutions, and Sharepoint

    TOP CONTRIBUTOR
    Posted Dec 30, 2019 12:01 AM
    Ryan,
        Regarding the non-solution aware SharePoint connectors, I start by creating the connection using a static value for Site Address because I have site columns that I want to modify the values to be in sync with data from my D365 system. Then once the entire flow is built and tested, I replace all the Site Address values with a Flow variable that gets its value from an Environment Variable (a new entity in your D365 default solution). You can read about Environment Variables here:
    https://powerapps.microsoft.com/en-us/blog/environment-variables-available-in-preview/

    In addition, I have found that there is no need to create the SP folder in advance, and therefore no need for a child workflow (in my use-case). When your Flow uses the Create File SP connector, the connector will create the folder and sub-folders if they do not exist. For example, in D365, I have a 'classic' workflow that populates a 'SP Folder' field (containing "Dev/Opportunity") when the Opportunity record is created.  In the example screen shot below,

    The down-side is that after I replace the Site Address with a variable, I cannot see the site columns (during Update File Properties) until I change the Site Address back to a static value.

    ------------------------------
    If this answered your question, please click on the arrow button next to Reply Inline and choose 'Make Best Answer.'
    Thanks.
    Nelson Johnson, Solution Architect
    BroadPoint, Inc., Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------



  • 3.  RE: Flow Embedded Connections, Child Flows, Solutions, and Sharepoint

    TOP CONTRIBUTOR
    Posted Dec 30, 2019 11:38 AM
    Edited by Nelson Johnson Dec 30, 2019 12:30 PM
    Ryan,
       I am appending my prior post: I am now getting an error when i try to save my flow because the SP "Update File Properties" connector will not accept the variable in the Site Address. I am getting the error:
    Flow save failed with code 'OpenApiOperationParameterValidationFailed' and message 'Input parameter 'item' validation failed in workflow operation 'Update_file_properties_managed_document_type': The API operation 'PatchFileItem' is missing required property 'item'.'.

    I will keep you posted if I can resolve it.


    ------------------------------
    If this answered your question, please click on the arrow button next to Reply Inline and choose 'Make Best Answer.'
    Thanks.
    Nelson Johnson, Solution Architect
    BroadPoint, Inc., Bethesda MD
    Link with me! https://www.linkedin.com/in/nelsonjohnson/
    ------------------------------



  • 4.  RE: Flow Embedded Connections, Child Flows, Solutions, and Sharepoint

    TOP CONTRIBUTOR
    Posted Dec 31, 2019 12:58 PM
    Thanks @Nelson Johnson, I have been able to create solution aware flows with Sharepoint References... I have not been able to do it as a parent/child flow in a solution. The error in that case indicates that triggering child workflows only supports embedded connectors, of which sharepoint is apparently not one (yet)?

    Ideally, for record creation, we've kept a single parent "creation handler" workflow that triggers appropriate child workflows. This allows us to control order of operation and prevent race conditions, something which becomes more complicated with parallel, async operations. In transitioning to Flow, we've previously run into this with a flow that added rows to an XLS spreadsheet on sharepoint, then copied the file, only to find that the copy would initiate before all the row add requests were processed by sharepoint. It wasn't exactly clear when sending these requests how to see the sharepoint responses to ensure they were all complete before sending the copy file request.  At any rate, I'm excited about the capabilities of flow as it already exceeds the old workflow's capabilities in many ways, offering far more flexiblitiy to add low-code snippets.  I am still working through best practices to ensure proper order of operations in flow when calling asynchronous steps, potentially having the flow triggered multiple times before the first instance is completed, etc.  As far as I know, as of today, there is not currently a way to add flows created outside of a solution into one, except manually recreating them. (Though the somewhat  new copy+paste feature is really awesome).

    Thanks for sharing your insight.

    ------------------------------
    Ryan Perry
    Business Systems Analyst
    Auric Solar
    ------------------------------



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