SharePoint – How to Easily find Field Name for REST API Use

Using SharePoint’s REST API could be easier, but it is fairly straight forward once you figure out some of the minor gotchas.

One of those gotchas is getting the field name correct when you’re specifying columns in the $select or $filter parameters.  For instance, a space is represented as ‘_x0020_’ so that a column named ‘Amount Approved’ would be specified as:   Amount_x0020_Approved

Another is when you have a ‘-‘ in your column name.  Just use ‘_x002d_’ in place of the dash.

To easily find what the system name of a column is, if you have Infopath installed, you can:

  1. Open your list in Infopath
  2. Right-click on the column you’re looking up
  3. Select ‘Field Properties’
    1. fieldprops
  4. The Name property is what you need for your REST OData calls in SharePoint
    1. fieldpropdet

One last tip:  to easily test your SharePoint REST urls, there are some great browser extensions that let you set up the details as needed.  I highly recommend Advanced Rest Client App for Chrome.  It’s simple and sweet.

Cheers!

Byron

No comments yet.

Leave a Reply

Powered by WordPress. Designed by Woo Themes