Coder Social home page Coder Social logo

tracygh / sharepointworkflowconverter Goto Github PK

View Code? Open in Web Editor NEW
16.0 3.0 6.0 80 KB

A proof-of-concept C# console application for retrieving legacy 2010 & 2013 custom SharePoint workflow definition files, and creating new Power Automate flows programmatically.

C# 100.00%
sharepoint-online sharepoint workflows powerautomate logicapps

sharepointworkflowconverter's Introduction

SharePointWorkflowConverter

A proof-of-concept C# console application for retrieving legacy 2010 & 2013 custom SharePoint workflow definition files, and creating new Power Automate flows programmatically.

General Notes:

  1. This project is a proof-of-concept to demonstrate that it's possible to programmatically retrieve/parse SharePoint legacy workflow definition files and create new Power Automate flows. As for specific use cases and implementation, this is a launch pad for you to build those out.
  2. Only compatible with SharePoint Online.
  3. Tested with a tenant global admin account.
  4. Uses the 4.7.2 .NET Framework.
  5. The code for retrieving legacy workflows and the code for creating a new Power Automate flow are contained in 2 separate respective functions: GetLegacyWorkflow() and CreateNewWorkflow(). If you don't need one or the other for your purposes, simply comment them out.

Notes about retrieving legacy 2010/2013 workflows:

  1. Legacy authentication must be enabled in the tenant for this code to work.
  2. All custom list/library workflows created within SharePoint Designer will have *.xoml and *.xoml.wfconfig.xml files. Each file contains pertinent information describing the workflow, such as list/library associations, actions, etc. You can manually view these files in SharePoint Designer 2013 by clicking All Files from the left-hand navigation and selecting > Workflows. The files can be programmatically retrieved using this project and parsed to map to equivalent Power Automate connections, actions, etc. SharePoint Designer Screenshot
  3. Declarative *.xoml and *.xoml.wfconfig.xml files do not appear to exist for workflows created from OOB SharePoint 2010 or 2013 workflow templates. (If you can find them - I'll buy you a beverage of your choice!)

Notes about creating Power Automate flows:

  1. This project leverages the Power Automate Management Web API to create a new Power Automate flow.
  2. Per Microsoft's documentation, flows shown in the My Flows tab are not supported by these APIs. Instead you will find flows created via the API in your Solutions > Default Solution tab.
    (I have opened a GitHub issue inquiring about how to programmatically create Power Automate flows within solutions other than Default.)
  3. The meat and potatoes of the flow payload is in the clientdata property. To help determine appropriate content for this section, I recommend manually creating the desired Power Automate flow using the UI. Then, you can leverage the API to get the clientdata content for your manual flow and copy/paste it into the payload for your new flow.
    (Also a great strategy for programmatically bulk-creating Power Automate flows in an environment!)
  4. Once you successfully create a new Power Automate flow via the API, you will need to turn it on. Then, do a Ctrl+F5 refresh to confirm your connections appear as expected.
    Power Automate Screenshot

Happy Automating! :-)

sharepointworkflowconverter's People

Contributors

tracygh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sharepointworkflowconverter's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.