[SharePoint] Using CamlQuery in REST API

OData URI is popular method to retrieve items of Sharepoint List using REST service. We can manipulate returned items by transform List URL using keywords like select, expand, filter, orderby, etc. There is a condition where we need to use camlquery and mixing with odata uri is not working at all.

Let say, we have this caml query:

We have 2  ways to call rest service :

1.  Put query into data object

2.  Append query into URL

No different in result return. The matter is only how we put the query into calling service code. Sometimes the #2 is a bit tricky when query contains double quotes instead of single quote.

[SharePoint] Generate CAML Query

CamlQuery is one of unique language you will play within Sharepoint. You can retrieve some result from Sharepoint List with certain conditions (filtering, sorting, grouping, etc.). But, creating Caml query is quite really a pain. The more complicated condition, more struggle we get. This query can be used not only limited to Server Object Model, but also Client Object Model. For this post, I will describe how to generate caml query for JSOM (Javascript Object Model) using help from camljs library.

Continue reading “[SharePoint] Generate CAML Query”

[SharePoint] Exporting List View to CSV file

Here, I am not reinventing the wheel by creating custom code to export SharePoint list items into CSV file. Because by default, SharePoint already has this feature called “Export to Excel” in the ribbon. Really? yeah, cool isnt it. In your list page, see the ribbon and open tab “List”

But this feature has some limitations, for example:

  • Host computer need to have Ms Sharepoint Foundation compatible application. (in my case, host pc doesnt have MS Office installed. Exporting list will output “owssvr.dll” and have no idea what it is)
  • Force us to use Internet Explorer. After clicking the export we will get a file called “owssvr.oty”. Open it in Ms Excel, and you are able to download the list items and result it excel table. But, if you open using Chrome for example, clicking the export button will redirect you to¬†a page with weirdos text on it. Seems like service configurations for our exporting list.
  • Not simple. Since we need to open it in IE, clicking export will output a config file, then go to download folder and open the output file in Ms Excel, download the list, etc etc.
  • In some conditions, this button get hidden means not supported or lack of permission or the list items is too big.

Continue reading “[SharePoint] Exporting List View to CSV file”

Encircle Text

I am creating a jquery plugin to encircle the text automatically when user typing in textbox or textarea. We can set any string to surround the text, for example below I use tilde (~) and hash (#).

$(‘input’).encircleText(‘~’)

 

$(‘textarea’).encircleText(‘#’)

 

 

See the demo here

See the the source here