Set SharePoint Workflow Variable to Site Group

Kelly Taggart 216 Reputation points
2021-06-03T00:04:40.38+00:00

I have an InfoPath Form in SharePoint that allows a user to select say Option A, B or C. I also have another Option field where there are 27 options.

I have a 2010 Workflow also attached to this List that performs an Approval. Due to the requirement, each of the 27 options have different approvers so I need to create 27 Approvals.

It has also now been requested, that if Option A is selected, that it goes to an additional specific approver, same for Option B and C.

I have created SharePoint Groups on the site for these approvers.

My question is, is it possible in the Workflow to set a Variable as say - IF "This Field" = Option A, set Workflow Variable to "Group A" - then I can use this Variable as an Approver in the Approval? This will save me having to create numerous more Approvals.

SharePoint Workflow
SharePoint Workflow
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Workflow: An orchestrated and repeatable pattern of business activity, enabling data transformation, service provision, and information retrieval.
545 questions
0 comments No comments
{count} votes

Accepted answer
  1. Kelly Taggart 216 Reputation points
    2021-06-10T00:06:06.477+00:00

    Firstly, it doesn't appear that it is possible to set a Workflow Variable to a SharePoint Group without development.

    The workaround I did was create a list on the same site with a Choice column with the same options and also a People column that allow groups. I added three items with the matching SharePoint Group.

    In the Workflow, I set the Variable:-

    If Current Item:Choice Column equals Option 1
    Set Variable to New List:Approval Column (with matching values being the choice column)

    103889-capture.png

    Not a perfect solution but will save much more time for me when creating the workflow. Hopefully this helps somebody else.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Emily Du-MSFT 43,661 Reputation points Microsoft Vendor
    2021-06-03T09:58:03.68+00:00

    @Kelly Taggart

    I tested in my environment, using a variable as approver in the approval workflow is not available.

    Creating 27 approval workflows seems to be the only way.


    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.