1

I have a workflow that is giving unexpected results. The workflow runs when a when an list item is added. It checks and retrieves all attachments on the list item and updates a field with the attachment URL.

The stages I have are broken down into

  • Calling the web service and retrieving the urls
  • Building the string
  • Updating the list item field.

The workflow works fine for one or two attachments. Anything above that throws an error:

Details: An unhandled exception occurred during the execution of the workflow instance. Exception details: System.ApplicationException: HTTP 500 {"Transfer-Encoding":["chunked"],"X-SharePointHealthScore":["0"],"SPClientServiceRequestDuration":["27"],"SPRequestGuid":["f798b4f9-aac5-a604-b579-b27adfad953d"],"request-id":["f798b4f9-aac5-a604-b579-b27adfad953d"],"X-FRAME-OPTIONS":["SAMEORIGIN"],"MicrosoftSharePointTeamServices":["15.0.0.4481"],"X-Content-Type-Options":["nosniff"],"X-MS-InvokeApp":["1; RequireReadOnly"],"Cache-Control":["max-age=0, private"],"Date":["Thu, 12 Mar 2015 14:17:08 GMT"],"Server":["Microsoft-IIS/8.0"],"X-AspNet-Version":["4.0.30319"],"X-Powered-By":["ASP.NET"]} at Microsoft.Activities.Hosting.Runtime.Subroutine.SubroutineChild.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

It appears to breakdown when assigning the new string variable. I can log the 3rd url. But after I add it to the variable and try to log the new variable I get nothing.

2

So turns out I was using the workflow history list to log the string I was building. On that list the description field is a single line text field, not a multi line. By logging the string to this list with the giant string I was building, I was running over the length of the field which caused my issue.

Also, I found that the maximum string length in sharepoint designer is 255 and will be truncated if it exceeeds that length. To get around this limit I instead updated the multi line list field directly adding one url at a time instead of building out the entire string and then updating the list item field.

https://msdn.microsoft.com/en-us/library/office/dn292551.aspx#bkm_05 https://technet.microsoft.com/en-us/library/cc262787.aspx

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.