I have a humdinger of a request I need to determine if it’s possible and/or more trouble than it’s worth if somebody wants to chime in
here’s the scenario
I need a field in an SP list to be built off 3 conditions
- Vendor name, which is typed in manually or by choice
- Current Year
- Number of documents we have done for that vendor in the current year
2 and 3 need to be calculated if possible. Â The name is then built based on those 3 criteria
number 3 is where I see a lot of difficulty
Hi
2. attach a workflow field which will calculate the year based on <<Created>> date field
3.you should have a separate list,with an item for each vendor, and in which you will update documents, based on main list value using also a workflow attached to the main list
You could use a workflow that fires on item added. It will make a REST call to get the items matching your vendor and filtered for the current year. The count of the items returned will be your #3. Save that into a column for your document in whatever format you want it.
Edit: You’ll want to track the “count” in a column, too. If you were to delete a document, the item count won’t be sufficient and you’ll get duplicates. If you keep the count in a column, each new item will use the REST call to get the appropriate items sorted by the count column. You will take the highest and increment it.
Disregard! I understood the problem incorrectly. 🙂
- Add a Vendor column to your document library.
- Add a custom view to your document library.
- Filter the view by the current year.
- Group the view by the Vendor column.
The grouping will include the Vendor’s name and the number of documents in the group.