Item attachments handling for Crow Canyon NITRO Forms and Portal (SharePoint Online)

Specifics of how attachments are handled in Portal Forms and NITRO Forms for SharePoint Online

Applies to: SharePoint Online

Please refer this article if you are using SharePoint On-premises (2013 / 2016/SharePoint Server Subscription Edition):  https://www.crowcanyon.help/article/328

Attachment Handling Details

Crow Canyon NITRO Forms and Portal create/update the SharePoint item using SharePoint APIs like REST and JSOM. Similarly, attachments are added to new item and added/removed from existing item using the APIs. For each attachment a separate operation has to be performed and with standard API, this increments the version of the item. This implies that if an item is created with 4 attachments, it will have 5 versions after the save. One version will be for normal save of the item and one version each for the attachments added to the item. Any downstream products like Workflows that are triggered on item update, will be triggered 5 times in quick succession and this can result in some issues like ‘save conflicts’ or inability to detect change in the item field values that workflows depend on.

This issue is handled in Crow Canyon Product in following ways:

  1. Forms code doesn’t use standard API to add/remove attachments from the item. Instead it directly works with folders to avoid creating versions and doesn’t fire the item update event while handling attachments
  2. Because of above, SharePoint standard forms and views don’t show the item attachments. So additional code is added in these forms to update the item properties to show the attachments

If you notice any issue in attachment handling then please refer below cases to idenfiy and configure the solutions to fix the issue.

SharePoint Online based Products:

1) Item Attachments not showing in Default SharePoint Forms (classic view) when attachments are added using Portal or NITRO Forms

A. Go to NITRO Apps page for the site and update the NITRO package by clicking ‘Update this Site’ link (if item is created using NITRO Forms), Upgrade the portal site from Crow Canyon Power Portal App by clicking the ‘Update’ button (if item is created using Portal).

B. Add Content Editor Web part to the SharePoint Display and Edit form. (Shown at end of this FAQ – Adding Content Editor).

2) Item Attachments not showing in CrowCanyon Forms Manager/Enhanced List Forms when attachments are added using Portal or Advanced Forms

– Upgrade to latest CrowCanyon Forms Manger App (if using CrowCanyon Forms Manager).

– Go to NITRO Apps page for the site and update the NITRO package by clicking ‘Update this Site’ link (if using Enhanced List forms or NITRO Forms)

– Upgrade the portal site from Crow Canyon Power Portal App by clicking the ‘Update’ button (if using Portal), upgrade to latest version of NITRO forms (if using NITRO forms)

3) Attachment Icon not showing in SharePoint List View when attachments are added using Portal or Nitro Forms

– Follow Steps A and B.

Note: The attachment Icon in SharePoint list view for items created using portal or NITRO forms will be shown only after the items are edited or viewed at least once. This doesn’t affect the functionality of forms in any way

4) Multiple Item Versions created and item create/update event fired multiple times upon item creation/update (for items created with attachments)

– This behavior is expected when an item is created with attachment(s) from Portal or NITRO forms by a user with out ‘Manage List’ and ‘Delete Item’ Permissions

– Give the users creating or editing items from portal ‘Manage List’, ‘Delete Item’ level permissions on the list used in the portal forms and make sure steps A and B (if using Default SharePoint Forms) are followed to fix this issue.View this link to know more about configuring custom level (Manage List) permissions.

Click here to know about managing user permisssions.

Note: If your users are using portal, giving users ‘Manage List’ permissions to the list used in Portal doesn’t give the user access to site of the list as the user is redirected to the portal when tries to access the backend site. View this link to know more information on Portal Redirect settings. Portal site shows Forms for lists in other sites and redirect functionality limits the users access to backend site as they can only work via the limited options that portal interface provides.

If however, your users are using NITRO forms, then ‘Manage List’ permissions will allow them to go to list settings page as they are using same site where list is located. In this case, if ‘Manage List’ permissions can’t be granted then attachments behavior reverts to creating multiple versions. This is not a concern in most of the cases unless you have multiple workflows configured on item/create update event.

Adding Content Editor

Please note that this is only necessary in rare case where you are not using Crow Canyon NITRO Forms or Crow Canyon Forms Manager solution for the list forms. Only if you are using standard SharePoint forms then these steps are required.

– Go to the list ribbon – expand Form Web Parts – select Default Display Form/Default Edit Form

– Edit Page and click on Add a Web Part, add content editor webpart

– Add Content Editor Web part

– Give Script Link to the content editor

– Give the script link “<script type="text/javascript"> if (typeof jQuery == 'undefined') { document.write(unescape('%3Cscript src="https://kendo.cdn.telerik.com/2017.3.1026/js/jquery.min.js"%3E%3C/script%3E')); } </script>
<script src="https://crowcanyon.azureedge.net/Common/CCS_RefreshAttachments.js" type="text/javascript"></script>
” and click on Ok.

– Edit the content editor webpart properties and hide the webpart so that it doesn’t appear on forms.

– Stop Editing the Page.

Leave a Reply