Invalid text value.
A text field contains invalid data. Please check the value and try again

Thanks to this post I’ve connected the dots that what I’m trying to do may have issues with field length. Well, it turned out that the item that I was running my workflow on had a long text field with over 255 characters. I tried to use that field for a task list field, which only allows up to 255 characters and BAM, found it

Hope this helps anyone!

]]>https://smindreau.wordpress.com/2018/01/31/sharepoint-workflow-and-long-text/feed/0eti2015-customdevsabberubbishblog-wf-1Corrupted Office Cache leads to “Sorry we couldn’t open xxxxx.xlsx” (on SharePoint)https://smindreau.wordpress.com/2017/09/07/corrupted-office-cache-leads-to-sorry-we-couldnt-open-xxxxx-xlsx-on-sharepoint/
https://smindreau.wordpress.com/2017/09/07/corrupted-office-cache-leads-to-sorry-we-couldnt-open-xxxxx-xlsx-on-sharepoint/#respondThu, 07 Sep 2017 07:26:36 +0000http://smindreau.wordpress.com/?p=1133I recently came across a nasty error with only 1 document on our SharePoint intranet that just didn’t want to open anymore. Error message:

Following those instructions didn’t work, but the idea was correct: delete the Office cache. So if those instructions don’t work for you either, follow these steps instead:

Double click on the Microsoft Office Upload center, you can find this on your notification bar on the bottom right corner (default location):

Go to settings:

And click “Delete cached files”:

That should do the trick!

]]>https://smindreau.wordpress.com/2017/09/07/corrupted-office-cache-leads-to-sorry-we-couldnt-open-xxxxx-xlsx-on-sharepoint/feed/0blog-excel-logosabberubbishblog-excelerror-1blog-excelerror-2blog-excelerror-3SharePoint Designer Workflow UnauthorizedAccessExceptionhttps://smindreau.wordpress.com/2017/08/21/sharepoint-designer-workflow-unauthorizedaccessexception/
https://smindreau.wordpress.com/2017/08/21/sharepoint-designer-workflow-unauthorizedaccessexception/#respondMon, 21 Aug 2017 12:24:15 +0000http://smindreau.wordpress.com/?p=1107I’ve run into issues with a SharePoint Designer workflow recently, not starting for some users. Well, it actually DID start, but then got canceled after a few seconds. No log history to be found and the following error message:

Access denied. You do not have permission to perform this action or access this
resource.

I’ve tried many things to debug the workflow (Windows Workflow Foundation – SharePoint Designer 2013 workflows) but to no avail.

Then I found the following post: SharePoint 2013 Workflow Permissions. As not all users have this issue, I thought I’d go ahead and give the users that have the issue explicit permissions instead of using an AD group.

And what do you know, the bug that was around in 2013 is still around.

In the long run, this is of course not a good solution as adding users explicitly everywhere isn’t manageable at all…

The HTTP status code 413 indeed signals a Request Entity Too Large. So I was starting to think that it had nothing to do with SharePoint. I looked through the IIS Failed Request Logs and found that my service was indeed throwing a 413 message.

What I’ve also found is that inside the message, there are several expected properties of the SPRemoteEventProperties object like BeforeProperties, AfterProperties that contain way more information than you’d expect. One such key in those dictionaries is “snapshots”. This is a SnapshotCollection XML string that contains all changes of all fields up until now. You can imagine how this grows…

As I didn’t find much documentation on this, I’ll just post the basic structure of this object here for future reference

]]>https://smindreau.wordpress.com/2017/06/29/http-413-for-remote-event-receivers/feed/0SharePointOnline2L-1sabberubbishPrinting field names as text in SharePoint Formshttps://smindreau.wordpress.com/2017/04/27/printing-field-names-as-text-in-sharepoint-forms/
https://smindreau.wordpress.com/2017/04/27/printing-field-names-as-text-in-sharepoint-forms/#respondThu, 27 Apr 2017 13:55:47 +0000http://smindreau.wordpress.com/?p=1013Have you ever modified a site page in SharePoint, wanting to add the value of a list item field without wanting to parse it to text yourself? I know I have.

And when you get that field using JSOM and just output it to HTML you get that fantastic [Object] output instead of the user name of the people picker field…

This post will help you.

What I’m trying to achieve is to get all list item properties in one call and in text format, not object format, so I don’t have to parse it to text myself.

Step 1: Getting your data

Let’s get some data! I’m using the page context to find out which list I’m in, and I’m using a function getParameterByName to get the “ID” query string variable:

Step 2: Use fields as text

The second line here does exactly the same as with item, but returns text, not objects. Don’t forget to actually execute your query, it’s now shown in my code.

Result

This allowed me to simply override a document set welcome page and insert some formatted tables instead of just all fields under each other. I did not have to bother to think about the different formats of fields, each field came out exactly as I wanted to see it:

Document set home page with custom tables to show fields more compact than all underneath each other.

]]>https://smindreau.wordpress.com/2017/04/27/printing-field-names-as-text-in-sharepoint-forms/feed/0eti2015-customdevsabberubbishgetFieldValuesAsTextResultCan’t create site template in SharePoint Onlinehttps://smindreau.wordpress.com/2016/12/07/cant-create-site-template-in-sharepoint-online/
https://smindreau.wordpress.com/2016/12/07/cant-create-site-template-in-sharepoint-online/#respondWed, 07 Dec 2016 08:17:22 +0000http://smindreau.wordpress.com/?p=1000I’ve recently hit a terrible problem with SharePoint Online. Wanted to use site templates for Projects and Teams, but when creating the site template, I got some unknown error.

Actually, when creating the template, the .wsp package was created successfully, so I could see it in the Solution Gallery. But it could not be activated.

After over 2 months (!) of Microsoft support ping-pong (not a sports discipline of my liking), they finally found the error.

Seems like you shouldn’t enable versioning on the Solution Gallery library. Go figure. Once the versioning was turned off, activating site templates worked like a charm.

We accidentally activated the versioning in batch when versioning all libraries in a site.

Who knows, this may help you out

]]>https://smindreau.wordpress.com/2016/12/07/cant-create-site-template-in-sharepoint-online/feed/0fast-scalable-versioningsabberubbishFinding SharePoint tasks that are assigned to groups you’re inhttps://smindreau.wordpress.com/2016/10/27/finding-sharepoint-tasks-that-are-assigned-to-groups-youre-in/
https://smindreau.wordpress.com/2016/10/27/finding-sharepoint-tasks-that-are-assigned-to-groups-youre-in/#respondThu, 27 Oct 2016 11:41:51 +0000http://smindreau.wordpress.com/?p=766This question has been posted multiple times around the web, and I didn’t really find a good way to handle it, so here goes.

Problem

You want your users to take advantage of the built-in task lists of SharePoint. But from BPM training and painful experience, you remember that assigning tasks to individual users is not a great idea. When users change function or leave the company, you are left with tasks that are assigned to no-one, leaving the radar.

So instead, you want to be able to assign tasks to SharePoint groups. And of course, you want to have a summary of the active tasks that are assigned to you, wherever those tasks are in your SharePoint farm (on premise) or tenant (Online).

The simple (local) workaround

This actually doesn’t solve the problem completely, but is an interesting local workaround. It has been documented all around the internet, so I’ll just give you the briefs.

This only works for a single task list, where you provision a View that shows all tasks that are directly assigned to me OR that are assigned to a group I’m in, translated into a SharePoint View CAML Query:

Note that we’ve also thrown in the CollapseSpecification. On the homepage, we don’t want a link to every single task. I just want to know what the total number of tasks is, and a link to each task list that contains tasks for me. Also, we’ll not be trimming duplicates, as in my specific case, tasks are very alike so I want to make sure I get the correct total task count.

This however, still doesn’t fix the issue yet, as we’re still only retrieving items that are assigned to me directly.

For the next step, you’ll have to provision a timer job, scheduled task or remote event receiver. This is my secret sauce, you may not like it, but it covers the end users’ requirements, is maintainable and is loosely coupled from SharePoint.

The (no longer so) secret sauce

The idea is that every time a task is created, an extra field is added and filled in with the complete list of actual users that are in those groups. That way, the field can be queried using Search to find tasks either assigned to me directly or assigned to me through a group. The Search Query now looks like this:

The field is called “ExpandedUsers” and contains the list of all assigned groups’ users per task. It is a multi-valued people-picker field that we’ll populate with the actual users in the group.

In the next section, I’ll talk about what choices you have to automate this, but we’ll need to automate this process nonetheless. This does provide an additional challenge: the “ExpandedUsers” field doesn’t exist anywhere, so we’ll need to provision that field in every site collection and for every task list as well. Ideally we would need to set the field to “Hidden”, but that way the Search crawler doesn’t pick up on the field’s value, so we’re leaving it visible.

The batch job modality

There are several ways to do the batch job:

Timer job: only possible with on premise SharePoint

Event Receiver: only possible with on premise SharePoint

Scheduled Windows Task using CSOM: works for both on premise and Online, is the modern counterpart of the timer job

Remote event receiver: works for both on premise and Online, is the modern counterpart of the event receiver

The timer job or scheduled tasks have the disadvantage of the delay between updates. If a new task is created, it will not appear on the homepage dashboard until the job is run and while running, it will also cover older tasks and hence will use more time than with event-based approaches.

The event-based approaches have the downside that if for some reason anything goes wrong with one task, it may never appear on the dashboard. This approach is less resilient to failure.

The worst downside for the event-based approach is that if group membership changes, the task list item will not be updated. If your groups are rather stable, this will be fine, but if they change once in a while, tasks may still get orphaned, not fulfilling the basic requirement of using groups for tasks.

The algorithm

What the batch job needs to do is not rocket science, but I’ll post some pseudo-code just in case.

Find all task lists in your farm/tenant (using Search)

This is required so that you can create your CSOM context.

For each task list
Open the SharePoint Context
Get the Web's groups
If the Web doesn't contain the field, create it (using XML)
If the List doesn't contain the field, add it
For each task in the list
Get the AssignedTo property
If it is a group, get the group members
If the user collection has changed, update the task list item

And that’s it really. It will take a few hours to develop the batch job, but if you’re used to CSOM, you’ll manage

Downsides

When you have alerts configured for the task list on item update, they will be triggered for each task. You cannot use SPList.SystemUpdate in CSOM, but the server side code does allow it. But as I’m a strong advocate for using SharePoint Online, I’m not elaborating on server-side code anymore.

You need to document these kind of timer jobs or event receivers rigorously so that they don’t get forgotten in the next update round (mostly applicable for on premise).

If you have many users in your SharePoint groups, we’re adding quite a lot of bulk to the individual task list items. This will have an implication on storage requirements. If you have groups with over 100 people and over 1000 tasks assigned to those kind of groups, remember that every one of those 1000 task will get 100 people in the multi-valued people picker field.

See the note on the event receiver downside.

The extra field ExpandedUsers cannot be Hidden, so users will see and be able to edit this field.

Questions? Hit the comments!

]]>https://smindreau.wordpress.com/2016/10/27/finding-sharepoint-tasks-that-are-assigned-to-groups-youre-in/feed/0done_tagsabberubbishModifying NewDocSet.aspx without dirty hackshttps://smindreau.wordpress.com/2016/09/15/modifying-newdocset-aspx-without-dirty-hacks/
https://smindreau.wordpress.com/2016/09/15/modifying-newdocset-aspx-without-dirty-hacks/#respondThu, 15 Sep 2016 11:20:32 +0000http://smindreau.wordpress.com/?p=810Typically when you browse the interwebs, you’ll get two answers to the question “how can I add JS to the new document set page?”:

Edit the master page

Edit the _layouts/15/NewDocSet.aspx

The first is a bad idea, because this adds extra weight to every page load in the site collection. And editing the master page is generally not recommended.

The second is an even worse idea, and cannot be deployed to SharePoint Online. It will also most probably break your code when you migrate to the next version, or migrate to Office 365.

So what can we do?

The Problem

The main issue here is that the NewDocSet.aspx is not a page in the virtual file system (i.e. in the content database), but in the physical file system (in the server hive), i.e. you can’t change it in the UI, nor in SharePoint Designer or other tools that have access to the WebDAV mounts of SharePoint.

So there’s no way to edit the web part on that page and add a JS Link to it.

The Solution

Using JSLink on a List field

This one is one of my favorites. I’ve recently discovered that this can be done.

Since SharePoint 2013, you can attach JS Link to a few levels, including View, Form, Web part, Content Type and Field. The Content Type is the most useful one, but unfortunately doesn’t work (a bug I guess).

But you can use the list field to accomplish this, for example (JavaScript Object Model, but could be C# CSOM as well):

Using a User Custom Action

Downside: this is deployed to the entire site (collection).
And I haven’t gotten it to work yet, as deploying user custom actions can be done on lists as well, but generally seem to offer less functionality and hooks than the site collection or site level.

Problem

As you can see, the familiar “EDIT LINKS” link is not there. This behavior was present in SharePoint Online as well.

Solution

Luckily, you can still change this under Site settings > Navigation (assuming the publishing feature is turned on, as the Enterprise Wiki is a publishing site site template).

Make sure you select “Structural Navigation” under Current Navigation:

Just below you’ll be able to change the actual links, which could also allow you to build a table of contents for your wiki:

Click OK to save.

Result

Look at that, we’ve added our link to the Quick Launch:

Note that in publishing sites, you will always be able to use this longer approach. For some reason, the basic standard “EDIT LINKS” just aren’t showing.

]]>https://smindreau.wordpress.com/2016/08/24/editing-the-quick-launch-on-an-enterprise-wiki-site/feed/0SharePointOnline2L-1sabberubbishenterprisewiki-editlinksmissingenterprisewiki-structuralnavigationenterprisewiki-editlinksenterprisewiki-result.pngWhy Information Management Mattershttps://smindreau.wordpress.com/2016/05/19/why-information-management-matters/
https://smindreau.wordpress.com/2016/05/19/why-information-management-matters/#respondThu, 19 May 2016 17:34:25 +0000http://smindreau.wordpress.com/?p=657I thought it was time to share my take on information management and why it is important for your organization.

Most organizations have their key processes well focused. They know how to do business and succeed in the market.

Mature organizations apply enterprise architecture patterns, a good call if you ask me. Large banks and number-crunching organizations alike are seriously getting their feet wet (and sometimes drowning) in data warehouse setups and intelligent analytics. A minority are already starting to peek at new advancements in business process paradigms. These professionalizations help ensure future profitability by managing under-the-hood resources.
And I can confirm that these strategies and tactics will make your organization better, more professional and are worth their buck. However, I still see an abundance of organizations fail at valuing their information.

Setting up an intranet or collaboration site is not what I’m getting at, nor is designing ERP systems or data warehouses in itself. I’m talking about real information management programs that encompass corporate vision and strategy to attain business goals. Goals like:

Reduce strategic project budget spills

Make sure 95% of employee on-boarding tasks get done before deadline

Provide customers insight into their complaint process

Attaining these goals cannot be done from day one. It takes workshops, where you actually need to rethink your current processes around information. Setting up a road map to get there.

But why, you may ask.

Because information is scattered around the organization, both online and offline. The amount of companies that still heavily rely on paper trails is incredible. And even when you think you’re being “digital”, you may still have a lot of out-of-process information that stays inside e-mailboxes. Employees come and go, and so does your information with them.Also, much of the information is not in context. It sits in a mailbox all alone, or is crying in a corner of (one of) your ERP system(s). Information leads to knowledge only be the interpretation of your employees. But if information is out of context or scattered all around, it takes employees more time to reach their conclusions and gain knowledge. This frustrates many employees, at times where employee engagement is a hot topic and employers want to keep their engaged employees in their inner circle.

Information storage also costs money. Not a lot, but it costs. Most organizations can cut on those costs by thinking about archival and records management as well as just cleaning out duplicates. The mere effort on thinking about it will cost more than you’ll save today. But we’re aiming at long-term strategies rather than just focusing on the quick wins.

What I’ve also seen a lot is corporate culture not recognizing that we live in a collaborative world where hiding information from one another is counterproductive, and is the basis for duplicate work. There is no single truth and no single location. I am yet to be convinced that this approach will actually make you take good decisions.

From my experience, information management is not on the agenda, at least with most companies. But information is in fact your key asset. Without it, you’ll lose from your competitors and have no insight into your markets or internal research. You’ll have no knowledge in fact. And its this knowledge that forms the basis of your strategic decisions. Decisions that aim to reach your business goals.

So to attain these goals, get a grip on your information: what do you have, where is it stored, who owns it? Enrich it by adding context to it, centralizing if needed. Then use intelligent techniques like search and multi-dimensional views to provide multiple entry points into your information. Together with smart dashboards, you’ll provide your employees with insight, and they’ll extract knowledge from that, which will help them to (e.g.):

Track project budget by integrating time sheet reporting, resources costs and planned costs in one dashboard.

Streamline the on-boarding process with basic tasks and reaching the entire organization during this process.

Engage with customers in concise portals which will also reduce phone conversations, e-mail clutter and allow for more self-service.

I’m not writing this blog post to sell anything. I just hope it reaches the right people to start thinking differently about information within their organization. It’s not only about public facing results. It’s mainly about awareness and investing your future in the information era.

And I’d like to end with one of my typical quotes, which my customers will probably start hating by now:

Information management is 80% about people, 15% about good design and only 5% about automation and technology.

(Thanks to AIIM research for pointing that out years ago, it’s still as applicable as it has ever been)