Start a workflow on items that already exist - sharepoint

I have added a workflow to a SharePoint(2007) calendar. The workflow copies information from Column A to Column B if Column A is not equal to Column B. I set this workflow to start when an item is created or modified. However, I would also like to start this workflow on all items that already exist in this calendar.
Is there a way I can do a mass start and run the workflow for all the items that already exist?
EDIT: Let me clarify my question a little more. I would like to run the workflow one time on the 200-300 items that have already been created. I don't need to traverse the items everytime a new item is added. Just one time to compare/copy Column A to Column B for all the existing items

Here's a low-tech method that should work. Go to the All Events view for the calendar, click Actions > Edit in Datasheet, then make an edit quickly to all event rows. Since it's a pseudo-spreadsheet view, you can set a value in the first row and then fill down all the rows. That would quickly modify each event, and thus should trigger the workflow.
If you don't want to edit an existing column (and lose any valuable data, for instance), you could just create a new column temporarily, go back into the datasheet view, and set a value in that column for all events. Once the workflows have been triggered, you could then just discard that column.

Add a customaction to the list's action panel through a feature that when clicked traverses all items matching the description (Column A != Column B), then triggering the workflow through the SPListItem's WorkflowAssociations

Related

SP2013 mulit value dropdown to indidual row

I have a SP2013 list with a multi value Person dropdown. Upon submit instead of a single row with all users listed out, I'd like each person to have their own row.
If I'm not wrong, unfortunately, that's not possible, in SharePoint every row is an item, if you want to achieve that, you need to create a single item per user.
If you need this for reporting, you can export the list to Excel (Ribbon -> Library tab -> Export to Excel) and in there customize your report per every user.

SharePoint send notification by assignation

I created in SharePoint a list. It has several columns, one of these columns is called assined to. It contains one or more person.
What i want, is that an email is send to the new person/s, if a new person is added to this column.
Now i searched a little bit, and found out that I should use Workflows to solve this problem. But the problem is the Workflow is started only automaticly if any changes are made in an element or when an element is created.
So my question is, is theire a possibility to trigger an email by content changes in a specified column.
By the way im working with a list in SharePoint 2013.
One way to accomplish this is to use an additional column on the list to track the previous assignment. Whenever an item is modified, the workflow can run and check the Assigned To field against the new Previous Assignment field. If they are different, the workflow can send the email and then update the Previous Assignment field to be equal to the current Assigned To value.
You can make the Previous Assignment field hidden from forms in the content type settings so that it won't be visible (and confusing) to users.
Yes, this would work. You would need to create a condition which checks on every change which is made to the item if the field "assigned to" is filled.
Here is nearly the same requirement at the MSDN Forums:
https://social.msdn.microsoft.com/Forums/office/en-US/112c2be9-5d3e-47d1-ad1c-06312de8a925/workflow-condition-assigned-to-is-not-empty?forum=sharepointcustomization

How to create a view using a count of certain field

I am trying to create a categorized view of all Notes documents that have a field with exact same value, i.e. there is a field for Contractor Name and I want to create a view that lists each Contractor and the documents that relevant to each. How do I do this? I have tried view formulas like the following but no success as yet
SELECT #IsAvailable(Contractorid) & #Count(Contractorid) > 1
SELECT #Count(#IsAvailable(Contractorid)) >1
Nsf databases are no relational databases. The count of different documents with a unique value in a specific field cannot be used to build a view selection formula.
You could write an agent, that runs through all documents and counts them and puts all with count > 1 in a folder, but this is quite a lot of LotusScript code and needs some advanced knowledge.
The other possibilit would be to categorize the view by ContractorId and add one column before that categorized column: simply use 1 as column formula and select "display totals" in the column properties as well as "hide details".
Then at least you have the information, how much documents are in each category, but unfortunately you cannot filter by it and you cannot sort by this column.
A third possibility would be to use an xpage interface, but that is even more work to do and a completely different story developmentwise.
This is similar to view to identify duplicates. My approach is to use folder.
Make a new folder with design of your view. Instead of (not working) selection formula use short LS code as an action, or QueryOpen event (make sure only one user runs the script).
The code should cooperate with another (hidden) view sorted by Contractorid. Make a ViewNavigator for that view and traverse through it with simple logic - if previous entry has the same Contractorid as the current one, put both documents into folder**. That way you will get list of all documents with duplicate Contractorid. Make sure to wipe all the current content from the folder at the start.
** This can be optimized further by slightly more complicated algorithm to handle first duplicate diferently - for more than two duplicates this algorithm makes extra calls of PutInFolder method.

Calculated SharePoint Column

I have a simple calculated column in my SharePoint 2010 list. It takes the list item ID, adds 100 to it.
When my users are creating items in the list, the calculated column does not get updated unless I go in, edit the column (do nothing) and save it. It, in fact, gives all items a value of 101 unless I manually edit the column.
Is this typical or is there a work around for this issue?
Thank you!
It is not possible to create calculated column based on ID value. The Id of the item is created after the item is added to the list.
You should use workflow instead.
The problem with using a workflow to do this (as per the accepted answer) is that workflow can take an appreciable time to execute. So you cannot create the ID until AFTER the new item is saved and there is always the danger that simultaneous users can create ID clashes that you also have to handle. If the workflow (as on a busy system) takes several minutes to work, you can also get the problem of someone else editing the item before the workflow has finished which may cause the workflow to fail leaving the item without any ID.
As an alternative, you might consider using JavaScript in the NewItem.aspx page to lookup and increment a counter from a separate list. Note that you have to update the counter as you read it if you are doing this so as to ensure that other users don't accidentally get the same ID if creating entries at the same time. This means that you must not mind the counter incrementing even if a user subsequently cancels the new item without saving.
As you noticed in opening/saving an item, The Calculated Column is updated on every item change.
Does it work to have a Workflow read the Title and write (the same) Title?
The [ID] reference in the Calculated Column should be set.
No need for an extra LookupID column then.

In SharePoint, how can the "Issue ID" column of an issues list be included in the detail form (DispForm.aspx) and/or alert emails?

We've created a pretty standard issue tracking system based off of SharePoint's template with just a few extra columns. On the list view (AllItems.aspx), the first column is called "Issue ID" and has a number. Our developers and QC use that number in discussions. However, that number doesn't seem to want to show up on the detail form (DispForm.aspx) nor in the alert email.
Can this field be included in at least one of these communication methods? If so, how?
Thank you.
We did something similar and used workflow via SharePoint Designer to copy the ID field into a field called "Issue Number". The workflow gets triggered automatically on Create / Edit (we included edit because the field can be modified by the user on the edit form and if that happens we want the number refreshed with the actual ID).
Before you create the workflow in SharePoint Designer, you need to add a column called "Issue Number" to the list you want to tweak.
List item
Open Sharepoint Designer
List item
Click File New -> Workflow
Give a name for the workflow
a. select the list from the dropdown
b. Uncheck Allow this workflow to be manually started and check automatically start on new and change then press Next
Give the step a name like "Assign Issue Number"
Create a Condition
If Compare a field -> If Issue Number not equals Current_Item:ID
Create an Action
Update List Item -> Set Issue Number to Current_Item:ID
Press Finished and test out by creating a new issue.
*The Issue Number will appear on the form and if you have emails setup to notify on assignment it will appear in the reassigned template.
*It will not appear in the created email confirmation because the workflow gets triggered after that email was executed.
I just added the issue ID using a total of 4 characters. Create a new column, set it to a Calculated column, in the formula type [ID]. Voila! The ID is now in your detail view.
The ID link returned the for me, however, the work around which sufficed for me was to enter 'Created' in the Calculated Column formula and ensure it is set at date and time. That then creates a unique idenity (unless you receive more than 1 list update per minute) than can be viewed in the email alert message

Resources