Google Apps Script

Class Column

A Sites Column - a column from a Sites List page.

Methods

MethodReturn typeBrief description
deleteColumn()voidDeletes this column.
getName()StringGets the name of this column.
getParent()PageReturns the List Page this column belongs to.
setName(name)ColumnSets the name of this column.

Detailed documentation

deleteColumn()

Deletes this column.

 
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
 var columns = page.getColumns();
 columns[0].deleteColumn();
 

getName()

Gets the name of this column.

 
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
 var columns = page.getColumns();
 var name = columns[0].getName();
 

Return

String — the column name


getParent()

Returns the List Page this column belongs to.

 
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
 var columns = page.getColumns();

 // This returns a reference to page
 var parentPage = columns[0].getParent();
 

Return

Page — the page this column belongs to


setName(name)

Sets the name of this column.

 
var page = SitesApp.getSite('example.com', 'mysite').getChildByName('mylistpage');
 var columns = page.getColumns();
 columns[0].setName("New Name");
 

Parameters

NameTypeDescription
nameStringthe new name

Return

Column — this Column for chaining

Authentication required

You need to be signed in with Google+ to do that.

Signing you in...

Google Developers needs your permission to do that.