Please find Below Code to get all list fields with Static Name and thus to get different file properties
1. Code to get all list fields
SP.SOD.executeFunc('sp.js', 'SP.ClientContext', function(){
var ctx=new SP.ClientContext.get_current();
var list = ctx.get_web().get_lists().getByTitle("TVC");
var listFields = list.get_fields();
ctx.load(listFields);
ctx.executeQueryAsync(Function.createDelegate(this, function(){
var listEnumerator = listFields.getEnumerator();
while (listEnumerator.moveNext()) {
var oField = listEnumerator.get_current();
var fType = oField.get_fieldTypeKind();
if(fType === SP.FieldType.choice) {
}
oField.get_staticName() ? title=oField.get_staticName() :title='';
console.log(title);
}
}), Function.createDelegate(this, function(){}));
});
2. Below are the List Fields
ContentTypeId
_ModerationComments
FileLeafRef
Modified_x0020_By
Created_x0020_By
File_x0020_Type
HTML_x0020_File_x0020_Type
_SourceUrl
_SharedFileIndex
PreviewOnForm
ThumbnailOnForm
_Author
FileType
ImageSize
Title
ImageWidth
ImageHeight
ImageCreateDate
_Comments
ThumbnailExists
PreviewExists
EncodedAbsThumbnailUrl
EncodedAbsWebImgUrl
NameOrTitle
Keywords
wic_System_Copyright
AlternateThumbnailUrl
MediaLengthInSeconds
PublishingStartDate
PublishingExpirationDate
VideoWidthInPixels
VideoHeightInPixels
VideoRenditionLabel
VideoRenditionBitRate
VideoSetDescription
VideoSetOwner
VideoSetThumbnailTimeIndex
VideoSetDefaultEncoding
VideoSetUserOverrideEncoding
VideoSetExternalLink
VideoSetEmbedCode
VideoSetShowDownloadLink
VideoSetShowEmbedLink
VideoSetRenditionsInfo
PeopleInMedia
NoCrawl
VideoCategory
ID
ContentType
Created
Author
Modified
Editor
_HasCopyDestinations
_CopySource
_ModerationStatus
FileRef
FileDirRef
Last_x0020_Modified
Created_x0020_Date
File_x0020_Size
FSObjType
SortBehavior
PermMask
CheckedOutUserId
IsCheckedoutToLocal
CheckoutUser
UniqueId
SyncClientId
ProgId
ScopeId
VirusStatus
CheckedOutTitle
_CheckinComment
LinkCheckedOutTitle
_EditMenuTableStart
_EditMenuTableStart2
_EditMenuTableEnd
LinkFilenameNoMenu
LinkFilename
LinkFilename2
DocIcon
ServerUrl
EncodedAbsUrl
BaseName
FileSizeDisplay
MetaInfo
_Level
_IsCurrentVersion
ItemChildCount
FolderChildCount
AppAuthor
AppEditor
SelectTitle
SelectFilename
Edit
owshiddenversion
_UIVersion
_UIVersionString
InstanceID
Order
GUID
WorkflowVersion
WorkflowInstanceID
ParentVersionString
ParentLeafName
DocConcurrencyNumber
No comments:
Post a Comment