Convert Sharepoint 2010 workflow to Power Automate

Kak Tak 11 Reputation points
2020-12-04T07:19:58.073+00:00

Hi All,

We have a very big issue when our workflow stopped working. I have notice that Sharepoint 2010 workflows are deprecated and now we need to upgrade our. Problem is that the guy who built this workflow quit and no one has the knowledge how to convert this to power automate. It is a simple workflow so I hope that someone can help us. It looks like this

If Current Item:Manually set all properties equals No
    Set Library to <Library Name Here>
    then Calculate 1000 plus Current Item:ID (Output to Variable: DocNo )
    then Set Document No to [%Current Item:Library%]_[%Current Item:Document Type:Abbreviation%] [%Variable:DOcNo%]
    then Set Namn to [%Current Item:Document No%]_[%Curren Item:Rubrik%]

I tried to convert this to 2013 but without success. Can someone please help use to convert to 2013 or to power automate.Please help guys

Microsoft 365 and Office | SharePoint Server | For business
Microsoft 365 and Office | SharePoint | For business | Windows
{count} votes

6 answers

Sort by: Most helpful
  1. Chelsea Wu 6,346 Reputation points Moderator
    2020-12-07T07:47:22.897+00:00

    Please confirm:

    1. What are (types of) the list fields that need to be filled or used by the workflow, for example, “Document Type:Abbreviation”, “Rubrik”?
    2. What is the trigger of the workflow/flow?

    Please share detailed configuration of your library and the 2010 workflow, with screenshots if possible.

    Here is the sample 2013 workflow built based on my understanding. The values for Document No and Name are built using String Builder in the workflow:
    45654-screenshot-2020-12-07-134850.png

    And the sample flow:
    45971-screenshot-2020-12-07-153151.png

    The expressions for variables are:

    DocNo = add(1000,triggerOutputs()?['body/ID'])  
    varDN = concat(triggerOutputs()?['body/Library'],'_',triggerOutputs()?['body/Document_x0020_Type_x003a_Abbreviation'],' ',variables('DocNo'))  
    varName = concat(variables('varDN'),'_',triggerOutputs()?['body/Rubrik'])  
    

    Here are your references:
    Workflow actions quick reference (SharePoint Workflow platform).
    Create a flow for a list or library in SharePoint or OneDrive.


    If an Answer is helpful, please click "Accept Answer" and upvote it.
    **Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread. **

    0 comments No comments

  2. Kak Tak 11 Reputation points
    2020-12-07T10:16:33.967+00:00

    Hi Chelsea,

    Many thanks for your help. Here are the answers:

    1) What are (types of) the list fields that need to be filled or used by the workflow, for example, “Document Type:Abbreviation”, “Rubrik”?

    Document Type:Abbreviation --> Type : Lookup
    Rubrik --> Single Line of text

    When it comes to workflow it looks like this. There are 3 local variables and one of them is DocNo.

    45716-2020-12-07-11-11-00-windows-10-pa-nm01-anslutning.png

    Problem here is when I try to re-create this in Sharepoint 2013 format I am not able to add DocNo variable. Under current Item --> ID (in original workflow is Integer) but in my re-created I am not able to change this to Integer

    45702-image.png

    45781-image.png

    45771-image.png


  3. Kak Tak 11 Reputation points
    2020-12-10T10:36:06.537+00:00

    Hi Chelsea,

    I have issues with the workflow. I am not getting DocumentType:Abbreviation, I am getting ID
    46922-image.png

    Could be something with this line varDN = concat(triggerOutputs()?['body/Library'],'_',triggerOutputs()?['body/Document_x0020_Type_x003a_Abbreviation'],' ',variables('DocNo'))

    I am not getting library field neither and I get a lot more field than you. What could be wrong. Please help

    46857-image.png


  4. Chelsea Wu 6,346 Reputation points Moderator
    2020-12-14T07:15:54.003+00:00

    Please note:

    1. All the available list columns will show in the “Update file properties” action and you will need to fill each with a proper value. The sample I provided does not include all the columns in your library.
    2. The “Library” column is a Text column I added manually and set with a default value of the Library name, so it will have a value when the flow is triggered and can be directly used in the variable expressions.
    3. The additional column “DocumentType:Abbreviation” will be filled automatically after you select a value for the DocumentType field, which in the flow displayed as DocumentType Id. (I was using a Text column in the sample, that is why it is not showing as “DocumentType Id”.)
      You will have to first give value to the DocumentType field when uploading the document, or give a value in the field Document Type Id so the flow can finish as expected.

    Here is the updated expression:

    concat(triggerOutputs()?['body/Library'],'_',triggerOutputs()?['body/Document_x0020_Type_x003a_Abbreviation/Value'],' ',variables('DocNo'))  
    

    In addition:
    In order to fill in all required values (DocumentType, for example) before the flow can do rest of the work, you can change the flow trigger to “When a file is created or modified (properties only)” (by deleting the old trigger and then add a new one), and a condition to identify if all necessary columns are filled under the “Initialize variable” actions.

    And one more condition to identify if the last change is done by the flow to prevent infinite trigger:

    triggerOutputs()?['body/modifiedbyflow'] is equal to 'false'  
    

    In order tenant, there is an OOB feature available for selection named "modified by flow". If you cannot find the property, use the expression to add it manually.

    Here is the updated sample:

    47819-screenshot-2020-12-14-140526.png


  5. Chelsea Wu 6,346 Reputation points Moderator
    2021-01-11T07:38:54.833+00:00

    It is by design that SharePoint 2013 platform workflow does not provide the lookup for additional fields of a lookup column.

    You can manually retrieve the Document Type:Abbreviation value using Lookup for String in the source list as following:

    55253-screenshot-2021-01-11-151500.png

    Here is the test outcome:

    55254-screenshot-2021-01-11-153243.png


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.