SharePoint Rest query approved check

If you set ‘Content Approval’ for the list, this OOTB field will be added into list.

Internal name : _ModerationStatus

Display name : Approval Status

fieldtype : ModStat

1. Caml Query :

Approved

/* CamlQuery viewXml
<Eq> <FieldRef Name=’_ModerationStatus’ /><Value Type=’ModStat’>Approved</Value>\
</Eq>\
*/

 

oListItem.get_item(‘_ModerationComments’);

oListItem.get_item(‘_ModerationStatus’);

2. Rest Query

/_api/Web/lists/getbytitle(‘LIST_DISPLAYNAME’)/Items&$filter=_ModerationStatus eq 0

data.d.results[i].OData_ModerationComments

data.d.results[i].OData_ModerationStatus

public enum SPModerationStatusType
{
Approved, //0
Denied, //1
Pending, //2
Draft, //3
Scheduled //4
}

SPModerationStatusType.Approved

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: