Custom Action, SharePoint 2013, SharePoint Designer, SharePoint Designer 2013

Using Custom Actions in SharePoint Designer 2013 to Kick off Site Workflow

Background
I recently posted how to delete a user from a site collection using SharePoint Designer workflow. Initially I wanted to create a Site Workflow so I could input any user I wanted into a initiation form field and have them removed 100%. I ran into some issues so I scaled it back just to users in the staff directory on my site. I still, however, wanted to make use of a custom action to delete the user from the site collection, from the list item menu, that also would delete the user after it completed deleting the user from the site collection, saving me some steps and time in my day.
I’ll explain the subtle nuances of creating a custom action for a list workflow and also a site workflow, as they do differ, as do the initiation forms. Thanks to the coder at SharePoint Musings for helping me figure out another way to launch it.
How I Got It To Work
In SharePoint Designer 2013, you’ll need to attach it to some list as a custom action. Since I’m already going to be in my staff directory, I decided to add a custom action there, and place it in the workflows section of the ribbon.
  • List workflow

    It is MUCH simpler to create a custom action to a list workflow. To do that, select your existing list from “List and Libraries”. You will see a “Custom Action” button appear in the ribbon. Choose whichever place you want your button. For me, I chose “List Item Menu”. Name your action “Delete from Site Collection” or something shorter like “Delete from SC”. You can create and upload a button for it as well if you wish. In the “Select Type of Action” area, choose “Initiate Workflow” and select your workflow you wish to launch. Ensure this workflow is set up to allow it to be launched manually.  

    To make the button appear in the “Workflows” section of the ribbon instead of a list item menu, you’ll need to change out the word “Actions” in the following:

    FROM Ribbon.ListItem.Actions.Controls._children TO Ribbon.ListItem.Workflows.Controls._children

  • Site workflow
    Follow the steps above for a list workflow but in the “Select Type of Action” area, choose “Navigate to URL” and paste the URL to your initiation page for your workflow. You can find this URL if you go to “Site Actions” for your site and then “Site Contents”  and go to the “Site Workflows” area located to the left of the “Recycle bin” and right clicking and copying the URL for the workflow you wish you use. You may want to remove the variable “Source” and it’s value from the URL or replace it with a URL you want the workflow to load after it’s launched.

Once  saved, go back to your site and you should now see a new custom action where you added it. 
I wish I started using this sooner, it really saves on time waiting for pages to load and combining administrative tasks, letting SharePoint do the work.