How do I expose the actual value of a Document Library custom column based on People and Groups in SharePoint 2013? - sharepoint

SharePoint 2013 in Office 365
I have added a custom column to a Document Library. The column is called "Author", and it is a lookup of type People and Group, filtered to show People only, and shows the field Name.
I have a workflow that is conditional upon the column being non-empty, but the Workflow builder doesn't have is empty or is not empty for that Current Item.FieldFromSource (Current Item:Author), so I've read the value into a string variable
Now I can check for existence:
However, I found that the behaviour of the Workflow was somewhat inconsistent, and as you probably know if you've read this far, Workflows are notoriously difficult to debug. So, I created a Task that would run after the loop, assigned to the CurrentUser, that would show the value of the two data items (this in the Task Description):
Value of author = [%Variable: Author_Value%]
Other author = [%Current Item:Author%]
When I run the Workflow (having set the Author to Joe Bloggs) and examine the Task, instead of the author's name it has more-or-less gibberish.
Two questions -
1 - how can I output the Name of the Author, since that's what I thought I'd done?
2 - why is there not an is empty / is not empty for lookups? All of them, no matter what they are bound to, only seem to expose equals / not equals.
Thanks, and hope this makes sense!
Edward

Just discovered that outputting the Current Item:Author as string is the issue - I've changed this to Display Names, Semicolon Delimited and it all works fine. I still don't understand why the condition builder on lookup columns doesn't give you more than equals / not equals but hey ho, this is SharePoint.

Related

How to eliminate string;# prepended to list field in three-state workflow notification?

I need to include two list values, [Office] and [Position ID] in a three-state workflow Task Title, which only allows selecting one column via dropdown. SharePoint Designer is not an option. Office is a choice column, while Position ID is single line of text. So, I had the idea to combine the two columns into a calculated column. This works fine for views, and displays as expected. However, when included as a list field in the Task Title of a three-state workflow, SharePoint prepends string;# to the calculated column value. Is there any way to prevent or workaround this? I have tried various concatenation methods within the calculated column formula, but it does not seem to have any effect on the workflow notifications. Any help would be appreciated.
Per my test, I could reproduce your issue:
However this is a hard coded workflow and we cannot change it.
Currently we could only manually remove the string;# via editing the task title in related task list.

How do I update a list item after adding it with Power Automate

I can't figure out how to do a very simple update of a column value in Power Automate in SharePoint online. I've seen examples of how to update an item on another list, but nothing that updates a value on the same item that was just added and triggered the workflow. Can anybody give me an example and maybe a very brief explanation?
I want to multiply the values of two columns and add it to a third column on the same item which will be blank. I used the formula to update the column I want using values from other columns. =[Dollar Amount]*[% Chance] but it says invalid syntax. There seems to be nothing intuitive in this new power automation and it's a horrible failure compared to how easy it used to be. MS is always making these mistakes.
The first method, you could use a calculated column.
=[% Chance]*[Dollar Amount]
Second method,use Flow.
Test result:
It's Power Automate, not power automation. Details matter.
First, try to set the column value when you create the item. Then you won't have to edit it. If you already know the values for [Dollar amount] and [% Chance] (Chance, really? Or Change?), then you can use these to generate the value before you create the item. You can do that in a variable or with a Compose action. Then create the item and refer to the variable or the Output of the compose action.
If this is not an option, you can use the Edit Item action and get the ID for the item from the action above that you used to create the item.
You say "MS is always making these mistakes." - It's more likely that the problem is a mismatch of data types, e.g. using text fields in calculations, or typos, or wrong syntax. That's not a mistake made by MS. Again, details matter.
Edit after comments: If the workflow is triggered by an item getting created, then you can use an Edit Item action and refer to the ID from the trigger item.

SharePoint Web Parts can not be connected via hyperlink fields

In short:
I'm trying to filter an XSLTListViewWebPart based on what is selected in another XSLTListViewWebPart. Using a String field as connection this is working fine. Using a hyperlink field no data is displayed.
In more detail:
I have two lists, say Accounts and Projects. Both have a hyperlink field accountURL.
All accounts have different accountURLs. Different projects can have the same value for accountURL. Both are displayed on a page using the XSLTListViewWebPart.
The simple goal is to filter the Projects list based on which item is selected in the Accounts list using the accountURL field. So I established a web part connection using the acountURL as a filter. Alas, when an item in the Accounts list is selected no items are showwn in the Projects list although I double checked that there are matching values.
When using a string field instead of a hyperlink field for accountURL everything works like a charm. Problem is, I need the hyperlink field.
Is this desired behaviour? Do you have any suggestions for a workaround?
(I already tried converting the hyperlink field to a string field via a calculated column which did not work out either.)
All was and is to be done in the web interface or SP-Designer. Coding a WSP is not an option for this problem. As I'm not quite familiar with the correct terminus technicus I use field and column interchangeably.
All help is greatly appreciated.
Ben
Someone on the Microsoft forum suggested the following workaround which does its job well:
Add a hidden text column to both lists.
Use a workflow which is triggered on item creation and update to copy the value of the hyperlink column to the hidden text column.
Connect both webparts using the hidden column as filter.
Nonetheless, I still wonder whether it is possible to use hyperlink columns or other special columns for filtering. I also had the problem that I cannot use a person column as lookup.
Does anyone know if whether there ist some kind of overview
which column types can be used for filtering/formulas/lookup/...?
Cheers,
Ben

Weird Workflow Behavior in Sharepoint 2007

I have a Document Library A and a list B.
When a document added to A, an item is created in B with the Title = A.Url. Another workflow runs whenever a document is updated in A which makes a lookup: B.Title = A.Url, and changes another column in B in found item.
Item Change Workflow always gives "Error Occurred: List item is not found". I modified the workflow to send me an e-mail containing the new (but unchanged) A.Url. It sent me the exact string with the one already in list B.
Anyways, why it can't find the item when the two columns are equal?
Thanks in advance.
Edit:
I literally hate Microsoft Sharepoint.
This is going to seem very unintuitive, but try "Building a Dynamic String" into a String variable, containing only [URL] from list A (or whatever the field name is). Then use this variable to perform your lookup against list B.
This voodoo magic has often worked for me when I encounter string comparison mysteries in SPD workflows.

Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it.
You can't add a new unique auto-generated ID to a SharePoint list, but there already is one there! If you edit the "All Items" view you will see a list of columns that do not have the display option checked.
There are quite a few of these columns that exist but that are never displayed, like "Created By" and "Created". These fields are used within SharePoint, but they are not displayed by default so as not to clutter up the display. You can't edit these fields, but you can display them to the user. if you check the "Display" box beside the ID field you will get a unique and auto-generated ID field displayed in your list.
Check out: Unique ID in SharePoint list
If you want to control the formatting of the unique identifier you can create your own <FieldType> in SharePoint. MSDN also has a visual How-To. This basically means that you're creating a custom column.
WSS defines the Counter field type (which is what the ID column above is using). I've never had the need to re-use this or extend it, but it should be possible.
A solution might exist without creating a custom <FieldType>. For example: if you wanted unique IDs like CUST1, CUST2, ... it might be possible to create a Calculated column and use the value of the ID column in you formula (="CUST" & [ID]). I haven't tried this, but this should work :)
I had this issue with a custom list and while it's not possible to use the auto-generated ID column to create a calculated column, it is possible to use a workflow to do the heavy lifting.
I created a new workflow variable of type Number and set it to be the value of the ID column in the current item. Then it's simply a matter of calculating the custom column value and setting it - in my case I just needed the numbering to begin at 100,000.
it's in there by default. It's the id field.
If you want something beyond the ID column that's there in all lists, you're probably going to have to resort to an Event Receiver on the list that "calculates" what the value of your unique identified should be or using a custom field type that has the required logic embedded in this. Unfortunately, both of these options will require writing and deploying custom code to the server and deploying assemblies to the GAC, which can be frowned upon in environments where you don't have complete control over the servers.
If you don't need the unique identifier to show up immediately, you could probably generate it via a workflow (either with SharePoint Designer or a custom WF workflow built in Visual Studio).
Unfortunately, calculated columns, which seem like an obvious solution, won't work for this purpose because the ID is not yet assigned when the calculation is attempted. If you go in after the fact and edit the item, the calculation may achieve what you want, but on initial creation of a new item it will not be calculated correctly.
As stated, all objects in sharepoint contain some sort of unique identifier (often an integer based counter for list items, and GUIDs for lists).
That said, there is also a feature available at http://www.codeplex.com/features called "Unique Column Policy", designed to add an other column with a unique value. A complete writeup is available at http://scothillier.spaces.live.com/blog/cns!8F5DEA8AEA9E6FBB!293.entry
So I am not sure I can really think of why you would actually need a "site collection unique" id, so maybe you can comment and let us know what is actually trying to be accomplished here...
Either way, all items have a UniqueID property that is a GUID if you really need it: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.uniqueid.aspx
Peetha has the best idea, I've done the same with a custom list in our SP site. Using a workflow to auto increment is the best way, and it is not that difficult. Check this website out: http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/
I give much appreciation to the person who posted that solution, it is very cool!!

Resources