Monthly Archives: Outubro 2018

ListItemPicker control

This control allows you to select one or more item from list, based in a column value, the control suggest values based on characters typed

Here is an example of the control:

ListItemPicker-selectlistListItemPicker-selectlist2

Can find the source code here :   https://github.com/joaojmendes/listItemPicker

How to use this control in your solutions

  •  run   npm i list-item-picker –save
  • Import the control into your component:
 
import { ListItemPicker } from 'list-item-picker/lib/listItemPicker';
  • Use the ListItemPicker control in your code as follows:
          <ListItemPicker
            listId='da8daf15-d84f-4ab1-9800-7568f82fed3f'
            columnInternalName='Title'
            itemLimit={2}
            onSelectedItem={this.onSelectedItem}
            context={this.props.context}
          />

Control Properties

 

Property Type Required Description
listId string yes Gui of List
columnInternalName string yes InternalName of column to search and get values
onSelectedItem: (item:any) =>void; function yes Callback function
className string no CSS className
webUrl string no URL of site if different of current site, user must have permissions
value Array no Default Value
disabled Boolean no Disable Control
itemLimit number yes Number os items to select / return
context WebPartContext|ApplicationCustomizerContext yes WebPart or Application customiser context
sugestedHeaderText string no Text header to display
noresultsFoundTextstring string no Text message when no items

 

I need upload to SharePoint Online Site about 7000 files to a document library as setup of ECM Project, and I develop a tool that permit upload files automatically based on information defined in CSV file.

The power user classify the file, defining Content Type and content type metadata, file path, destination document library, in my case we use the content organizer,  and content organizer rules to route files for their destination. The document library is a DropOff library, but we can specify any library as destination.

the csv file has fill rules that have to be met, particularly with regard to specifying the metadata associated with the file.

The rules are:

The first 3 columns are fixed , the first column define the local (pc) file Path to upload,  second, the content type name and the third is SharePoint Document Library (Destination).

the fourth and next columns are variable and define the metadata associated to content type. The columns must have the internal names of columns in SharePoint Document Library and their values must be compatible with columns.

For Metadata Columns the values must be in format “termgroup|termset|term”,

For lookup Columns the values must be the value of reference column defined on Lookup Column.

For Date Columns the values must be in format “pt-PT”  I will check if the current (PC or Server ) culture is equal.

We must have one file for each content type that we want upload.

Sample CSV file.

Screenshot 2018-10-08 at 09.53.25

My PowerShell script Print Screens,

Screenshot 2018-10-08 at 11.02.35

Screenshot 2018-10-08 at 11.10.29

You must change the script for your needs, use as a reference .

The code is here :

https://github.com/joaojmendes/BulkUploadFilesToSharePoint