Flow Error Unable to process template language expressions for action

Unable to process template language expressions for action 'Apply_to_each_sftp_file' at line '1' and column '30517': 'The template language expression 'body('List_files_in_folder')?['body']' cannot be evaluated because property 'body' cannot be selected. Array elements can only be selected using an integer index. Please see https://aka.ms/logicexpressions for usage details.'.

From one day to the next one of my flows stopped working with the error above. The flow is super simple:
Get files from an SFTP folder
Loop through the files
Copy file to another location
Delete file

Looking at the apply to each step I noticed body element was referenced. This might have been related to how I set up the loop or the autogenerated action.

Action the flow was unhappy with:

Updated the flow and it started working:

Note how the ?[‘body’] element is missing from the second picture.

Fix?
Created a new Apply to each loop by first setting a variable to the name of the file I’m looping on, then added my other actions. There might be a better way to fix this, but for now, this is what works.



Error Microsoft.Office.RecordsManagement.RecordsRepository.Record

One one my testers was receiving this error when testing a PowerShell script that was doing records management in SharePoint.

System.Management.Automation.RuntimeException: Unable to find type [Microsoft.Office.RecordsManagement.RecordsRepository.Records]: make sure that the assembly containing this type is loaded.
at System.Management.Automation.TypeLiteral.resolveType()
at System.Management.Automation.TypeNode.ResolveType()
at System.Management.Automation.TypeNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
at System.Management.Automation.AssignmentStatementNode.Execute(Array input, Pipe outputPipe, ExecutionContext context)
at System.Management.Automation.StatementListNode.ExecuteStatement(ParseTreeNode statement, Array input, Pipe outputPipe, ArrayList& resultList, ExecutionContext context)

User was remoted into a SharePoint server, but did not have the right permissions on the server. I tried adding the user to Power Users group, but that didn’t help. Ended up adding the users to the local server Administrators group and the error went away.

Classic ASP Update Records in Access Error [Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

I was trying to update an Access database from a classic ASP page and encountered this error:

[Microsoft][ODBC Microsoft Access Driver] Operation must use an updateable query.

The fix is outlined here:

http://support.yessoftware.com/kb_article.asp?article_id=72

In a modern OS, you need add the local IUSR account to the folder that holds your database.  The account will need read and write access.

Who knew that classic ASP was so much fun to work with?

List of Classic ASP Errors

Oh what fun it is to update a classic ASP site…

The link below outlines a bunch of common errors and a little detail about each.
https://msdn.microsoft.com/en-us/library/ms681549(v=vs.85).aspx

Number ErrorValueEnum constant Description/Possible causes
3000 adErrProviderFailed Provider failed to perform the requested operation.
3001 adErrInvalidArgument Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another. This error is often caused by a typographical error in an SQL SELECT statement. For example, a misspelled field name or table name can generate this error. This error can also occur when a field or table named in a SELECT statement does not exist in the data store.
3002 adErrOpeningFile File could not be opened. A misspelled file name was specified, or a file has been moved, renamed, or deleted. Over a network, the drive might be temporarily unavailable or network traffic might be preventing a connection.
3003 adErrReadFile File could not be read. The name of the file is specified incorrectly, the file might have been moved or deleted, or the file might have become corrupted.
3004 adErrWriteFile Write to file failed. You might have closed a file and then tried to write to it, or the file might be corrupted. If the file is located on a network drive, transient network conditions might prevent writing to a network drive.
3021 adErrNoCurrentRecord Either BOF or EOF is True, or the current record has been deleted. Requested operation requires a current record.

An attempt was made to update records by using Find or Seek to move the record pointer to the desired record. If the record is not found, EOF will be True. This error can also occur after a failed AddNew or Delete because there is no current record when these methods fail.

3219 adErrIllegalOperation Operation is not allowed in this context.
3220 adErrCantChangeProvider Supplied provider is different from the one already in use.
3246 adErrInTransaction Connection object cannot be explicitly closed while in a transaction. A Recordset or Connection object that is currently participating in a transaction cannot be closed. Call either RollbackTrans or CommitTrans before closing the object.
3251 adErrFeatureNotAvailable The object or provider is not capable of performing the requested operation. Some operations depend on a particular provider version.
3265 adErrItemNotFound Item cannot be found in the collection corresponding to the requested name or ordinal. An incorrect field or table name has been specified.
3367 adErrObjectInCollection Object is already in collection. Cannot append. An object cannot be added to the same collection twice.
3420 adErrObjectNotSet Object is no longer valid.
3421 adErrDataConversion Application uses a value of the wrong type for the current operation. You might have supplied a string to an operation that expects a stream, for example.
3704 adErrObjectClosed Operation is not allowed when the object is closed. The Connection or Recordset has been closed. For example, some other routine might have closed a global object. You can prevent this error by checking the State property before you attempt an operation.
3705 adErrObjectOpen Operation is not allowed when the object is open. An object that is open cannot be opened. Fields cannot be appended to an open Recordset.
3706 adErrProviderNotFound Provider cannot be found. It may not be properly installed.

The name of the provider might be incorrectly specified, the specified provider might not be installed on the computer where your code is being executed, or the installation might have become corrupted.

3707 adErrBoundToCommand The ActiveConnection property of a Recordset object, which has a Command object as its source, cannot be changed. The application attempted to assign a new Connection object to a Recordset that has a Command object as its source.
3708 adErrInvalidParamInfo Parameter object is improperly defined. Inconsistent or incomplete information was provided.
3709 adErrInvalidConnection The connection cannot be used to perform this operation. It is either closed or invalid in this context.
3710 adErrNotReentrant Operation cannot be performed while processing event. An operation cannot be performed within an event handler that causes the event to fire again. For example, navigation methods should not be called from within a WillMove event handler.
3711 adErrStillExecuting Operation cannot be performed while executing asynchronously.
3712 adErrOperationCancelled Operation has been canceled by the user. The application has called the CancelUpdate or CancelBatch method and the current operation has been canceled.
3713 adErrStillConnecting Operation cannot be performed while connecting asynchronously.
3714 adErrInvalidTransaction Coordinating transaction is invalid or has not started.
3715 adErrNotExecuting Operation cannot be performed while not executing.
3716 adErrUnsafeOperation Safety settings on this computer prohibit accessing a data source on another domain.
3717 adWrnSecurityDialog For internal use only. Don’t use. (Entry was included for the sake of completeness. This error should not appear in your code.)
3718 adWrnSecurityDialogHeader For internal use only. Don’t use. (Entry included for the sake of completeness. This error should not appear in your code.)
3719 adErrIntegrityViolation Data value conflicts with the integrity constraints of the field. A new value for a Field would cause a duplicate key. A value that forms one side of a relationship between two records might not be updatable.
3720 adErrPermissionDenied Insufficient permission prevents writing to the field. The user named in the connection string does not have the proper permissions to write to a Field.
3721 adErrDataOverflow Data value is too large to be represented by the field data type. A numeric value that is too large for the intended field was assigned. For example, a long integer value was assigned to a short integer field.
3722 adErrSchemaViolation Data value conflicts with the data type or constraints of the field. The data store has validation constraints that differ from the Field value.
3723 adErrSignMismatch Conversion failed because the data value was signed and the field data type used by the provider was unsigned.
3724 adErrCantConvertvalue Data value cannot be converted for reasons other than sign mismatch or data overflow. For example, conversion would have truncated data.
3725 adErrCantCreate Data value cannot be set or retrieved because the field data type was unknown, or the provider had insufficient resources to perform the operation.
3726 adErrColumnNotOnThisRow Record does not contain this field. An incorrect field name was specified or a field not in the Fields collection of the current record was referenced.
3727 adErrURLDoesNotExist Either the source URL or the parent of the destination URL does not exist. There is a typographical error in either the source or destination URL. You might have http://mysite/photo/myphoto.jpg when you should actually have http://mysite/photos/myphoto.jpg instead. The typographical error in the parent URL (in this case, photo instead of photos) has caused the error.
3728 adErrTreePermissionDenied Permissions are insufficient to access tree or subtree. The user named in the connection string does not have the appropriate permissions.
3729 adErrInvalidURL URL contains invalid characters. Make sure the URL is typed correctly. The URL follows the scheme registered to the current provider (for example, Internet Publishing Provider is registered for http).
3730 adErrResourceLocked Object represented by the specified URL is locked by one or more other processes. Wait until the process has finished and attempt the operation again. The object you are trying to access has been locked by another user or by another process in your application. This is most likely to arise in a multi-user environment.
3731 adErrResourceExists Copy operation cannot be performed. Object named by destination URL already exists. Specify adCopyOverwrite to replace the object. If you do not specify adCopyOverwrite when copying the files in a directory, the copy fails when you try to copy an item that already exists in the destination location.
3732 adErrCannotComplete The server cannot complete the operation. This might be because the server is busy with other operations or it might be low on resources.
3733 adErrVolumeNotFound Provider cannot locate the storage device indicated by the URL. Make sure the URL is typed correctly. The URL of the storage device might be incorrect, but this error can occur for other reasons. The device might be offline or a large volume of network traffic might prevent the connection from being made.
3734 adErrOutOfSpace Operation cannot be performed. Provider cannot obtain enough storage space. There might not be enough RAM or hard-drive space for temporary files on the server.
3735 adErrResourceOutOfScope Source or destination URL is outside the scope of the current record.
3736 adErrUnavailable Operation failed to complete and the status is unavailable. The field may be unavailable or the operation was not attempted. Another user might have changed or deleted the field you are trying to access.
3737 adErrURLNamedRowDoesNotExist Record named by this URL does not exist. While attempting to open a file using a Record object, either the file name or the path to the file was misspelled.
3738 adErrDelResOutOfScope The URL of the object to be deleted is outside the scope of the current record.
3747 adErrCatalogNotSet Operation requires a valid ParentCatalog.
3748 adErrCantChangeConnection Connection was denied. The new connection you requested has different characteristics than the one already in use.
3749 adErrFieldsUpdateFailed Fields update failed. For further information, examine the Status property of individual field objects. This error can occur in two situations: when changing a Field object’s value in the process of changing or adding a record to the database; and when changing the properties of the Field object itself.

The Record or Recordset update failed due to a problem with one of the fields in the current record. Enumerate the Fields collection and check the Status property of each field to determine the cause of the problem.

3750 adErrDenyNotSupported Provider does not support sharing restrictions. An attempt was made to restrict file sharing and your provider does not support the concept.
3751 adErrDenyTypeNotSupported Provider does not support the requested kind of sharing restriction. An attempt was made to establish a particular type of file-sharing restriction that is not supported by your provider. See the provider’s documentation to determine what file-sharing restrictions are supported.

PowerShell Unable to index into an object of type Microsoft.SharePoint.SPList.

Made a change to an existing PowerShell script, then ran into this error: Unable to index into an object of type Microsoft.SharePoint.SPList

If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }

$web = Get-SPWeb "http://sharepointed.com/sitename"
$listTask = $web.Lists["My List"]
$sItem = $listTask.GetItemById(9)

$title = $listTask["Title"]

In the script, you will notice that I’m trying to capture the title of the item. The above script wasn’t working because I failed work with this list item, instead I was trying to work with the list object.

Correct script:

If ((Get-PSSnapIn -Name Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue) -eq $null )
{ Add-PSSnapIn -Name Microsoft.SharePoint.PowerShell }

$web = Get-SPWeb "http://sharepointed.com/sitename"
$listTask = $web.Lists["My List"]
$sItem = $listTask.GetItemById(9)

$title = $sItem["Title"]

Error When Updating Item Using Web Service MoveNext

Using the SharePoint REST service to update items, ran into this error:

Unable to update the sharepoint document – An error occurred while processing this request.System.Data.Services.Client.DataServiceClientException: <?

xml version=”1.0″ …

…..

at System.Data.Services.Client.DataServiceContext.SaveResult.<HandleBatchResponse>d_1e.MoveNext()

The target list was set to require checkout before items could be updated.  Once I set require checkout to No, the REST service was able to update items.

 

Accessing search.asmx from a site collection

My goal was to setup a desktop app to query the SharePoint Search Web Service located at: http://webApp/managedPath/siteCollection/_vti_bin/search.asmx

Guide for creating the app:
http://msdn.microsoft.com/en-us/library/ff394650.ASPX

In my app, I needed to query a site collection, not the root site. Also needed to pass in my test-account username, password, and domain.

Error 1:

System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> Attempted to perform an unauthorized operation.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
.....

Error 2:

System.Net.WebException: The request failed with HTTP status 401: Unauthorized.
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)

Error1 was the primary issue.
Error2 was related to an incorrect login.

When creating my app, I used a web reference pointing to http://webApp/managedPath/siteCollection/_vti_bin/search.asmx . After receiving Error1 countless times, I opened the App.config file. In there I found the answer…

For some great reason, Visual Studio updated the reference to point to the root web app, not the site collection.

http://webApp/_vti_bin/search.asmx

Updated the App.config file to point to the site collection, no more Error1.

http://webApp/managedPath/siteCollection/_vti_bin/search.asmx

Connection I used:

//queryService.Credentials = System.Net.CredentialCache.DefaultCredentials;
queryService.Credentials = new NetworkCredential("testAccountName", "thePassword", "domain");

HTMLCHECKERLib.XMLPProcessorClass The form template failed to load

Lists that use InfoPath for the display and edit forms were randomly producing errors. It was randomly happening because, one of the WFE servers in the farm was out of sync.

To test, I logged into each WFE, then tried to display the list forms. Testing worked on one box but failed on the other.

From the WFE that was not displaying the forms, I ran the following command.

From the start menu, locate the Command Prompt icon, right click on it, then click on Run as administrator. One the command window opens, paste in the command below.

regsvr32 “C:\Program Files\Common Files\Microsoft Shared\OFFICE14\htmlchkr.dll”

This will not cause an IISreset.

Couple of the errors in the log.

10/18/2013 09:05:28.16 w3wp.exe (SPW2:0x46DC) 0x2D30 InfoPath Forms Services Maintenance 82fv Critical The form template failed to load. (User: domain\user, Form Name: Template, IP: , Request: http://sharepointed.com/site/Lists/listname/blah.aspx, Form ID: urn:schemas-microsoft-com:office:infopath:list:-AutoGen-2012-11-28T21:23:23:720Z, Type: InvalidCastException, Exception Message: Unable to cast COM object of type ‘HTMLCHECKERLib.XMLPProcessorClass’ to interface type ‘HTMLCHECKERLib.IHTMLtoXHTML’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{A260B372-BC78-441B-8764-D0B83F4004F4}’ failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).) 9130d182-80de-4da7-96d6-b2a566aea3e7
• 10/18/2013 09:05:28.18 w3wp.exe (SPW2:0x46DC) 0x2D30 InfoPath Forms Services Runtime 8gec Exception Unhandled exception when rendering form System.InvalidCastException: Unable to cast COM object of type ‘HTMLCHECKERLib.XMLPProcessorClass’ to interface type ‘HTMLCHECKERLib.IHTMLtoXHTML’. This operation failed because the QueryInterface call on the COM component for the interface with IID ‘{A260B372-BC78-441B-8764-D0B83F4004F4}’ failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)). at HTMLCHECKERLib.XMLPProcessorClass.Convert(String bstrHTML) at Microsoft.Office.InfoPath.Server.DocumentLifetime.EventRichTextChange.HtmlToCleanXHtml(String html, Boolean makeDomCompatible) at Microsoft.Office.InfoPath.Server.SolutionLifetime.ItemFieldConnectorRichText.WriteValueNode(ListField fieldInformation, XmlWriter resultWriter, Object value) at Microsoft.Office.InfoPath.Server.SolutionLifetime.ItemFieldConnectorRichText.WritePropertyFromItem(Context context, ResultListItem listItem, XmlWriter resultWriter, ListField fieldInformation, String itemFieldsNamespacePrefix, String itemFieldsNamespace) at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.PopulateXmlForMultipleItems(Context context, ResultListItemIterator listItems, Dictionary`2 existingFields, Int64& auxDomSize) at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.PopulateXmlForSingleItem(SPListItem listItem, SPListItemVersion currentVersion, XPathNavigator resultFields, Dictionary`2 existingFields, Document document, Int64& auxDomSize) at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.LocalListItemQuery(SPContentTypeId contentTypeId, Document document, XPathNavigator resultFields, Boolean& needRegenerateChoice, Dictionary`2& existingFields, Int64& auxDomSize) at Microsoft.Office.InfoPath.Server.SolutionLifetime.DataAdapterListDataProvider.Execute(String siteUrl, Guid listId, SPContentTypeId contentTypeId, Document document, DataAdapterListDataProvider documentAdapter, Boolean useDcl, XPathNavigator queryFields, XPathNavigator resultFields, Boolean isListItemEditing, Boolean discoveryOnly, Int64& auxDomSize) at Microsoft.Office.InfoPath.Server.DocumentLifetime.DataAdapterListDataProvider.ExecuteInternal(XPathNavigator queryFields, XPathNavigator resultFields, Boolean useListItemMode) at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesActionQueryListItem.ExecuteRule(Document document) at Microsoft.Office.InfoPath.Server.SolutionLifetime.RuleAction.EvaluateExpression(Document document, XPathNavigator currentTarget) at Microsoft.Office.InfoPath.Server.SolutionLifetime.RulesRuleSet.EvaluateExpression(Document document, XPathNavigator targetNavigator) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.FireRulesHelper(Boolean onLoadRules) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.PerformOnLoadEvent(Dictionary`2 intputParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.LoadSolutionAndDocument(HttpContext context, Solution solution, DocumentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.OpenDocumentWithSolution(HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) at Microsoft.Office.InfoPath.Server.DocumentLifetime.Document.NewFromSolution(HttpContext context, SPSite contextSite, Solution solution, DocumentMetaInformation documentMetaInformation, Boolean disableFirstRequestOptization, OnInitializeCallback onInitializeCallback, OpenParameters openParameters) at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.DataBindInternal(SolutionMetaInformation solutionMetaInformation, DocumentMetaInformation documentMetaInformation, String absoluteSolutionLocation, Boolean hasCloseHandler, Document& document) at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.StartNewEditingSession() at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.EnsureDocument(EventLogStart eventLogStart) at Microsoft.Office.InfoPath.Server.Controls.XmlFormView.<>c__DisplayClass8.b__5() at Microsoft.Office.Server.Diagnostics.FirstChanceHandler.ExceptionFilter(Boolean fRethrowException, TryBlock tryBlock, FilterBlock filter, CatchBlock catchBlock, FinallyBlock finallyBlock) 9130d182-80de-4da7-96d6-b2a566aea3e7

Parameter name: userProfileApplicationProxy

Had a contractor leave the company and return. Often this creates issues because we don’t run a ‘dead account cleaner’ often enough.

To get around this, I run the script below to get the ‘new’ Active Directory account synced with the new Active Directory account.

Script:

$user = Get-SPUser -web "http://sharepointed.com" -Identity "Mydomain\TheUser"
Move-SPUser -Identity $user -newalias "Mydomain\TheUser" -IgnoreSID 

Where I went wrong… I remoted’ into one of the servers in the farm using my personal NT login. By doing this, I was receiving the error below. Once I remoted’ into the server using the Admin account, I was able to run the script.

Error:
Move-SPUser : Value cannot be null.
Parameter name: userProfileApplicationProxy
At line:1 char:12
+ Move-SPUser <<<< -Identity $user -newalias "Mydomain\TheUser" -IgnoreSID + CategoryInfo : InvalidData: (Microsoft.Share...PCmdletMoveUser: SPCmdletMoveUser) [Move-SPUser], ArgumentNullException + FullyQualifiedErrorId : Microsoft.SharePoint.PowerShell.SPCmdletMoveUser

job admin apppool change FIXED

Error when trying to change the password for a Managed Account in SharePoint 2010:

Error deploying administration application pool credentials.
Another deployment may be active. An object of the type
Microsoft.SharePoint.Administration.SPAdminAppPoolCredentialDeploymentJobDefinition named
“job-admin-apppool-change” already exists under the parent Microsoft.SharePoint.Administration.SPTimerService named “SPTimerV4”. Rename your object or delete the existing object.

In my case, I needed to change the account that the SharePoint 2010 Timer service was running as. Every time I tried to update the password, the Timer would stop and the update would fail. Once I changed the Run As of the Timer, I was able to update the password.

Add-PSSnapin Microsoft.SharePoint.PowerShell -EA silentlycontinue

$m = Get-SPManagedAccount -Identity "domain\YourAccount"

Set-SPManagedAccount -Identity $m  -ExistingPassword (ConvertTo-SecureString "Your PASSWORD" -AsPlainText -force) –confirm