I suggest you ....

Set internal site field name using REST API

We use the following call to create a site field:
$.ajax({
url: appweburl + "/_api/SP.AppContextSite(@target)/web/fields?@target='" + hostweburl + "'",
type: "POST",
data: JSON.stringify({
'__metadata': { 'type': 'SP.Field' },
'FieldTypeKind': fieldType, 'InternalName': fieldInternalName, 'Title': fieldDisplayName, 'Group': fieldGroup, 'Required': fieldRequired, 'Hidden': fieldHidden
}),
headers: { "accept": "application/json;odata=verbose", "content-type": "application/json;odata=verbose", "X-RequestDigest": $("#__REQUESTDIGEST").val() },
success: function (data) { console.log("Custom field successfully created");},
error: function (err) { alert(JSON.stringify(err)); }
})

However, the internal name is not set to the parameter fieldInternalName. It seems that the internal name is also set to the display name and suffix. Would it be possible to specify the internal field name via REST?

Thanks!

53 votes
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    Luc Verstrepen shared this idea  ·   ·  Flag idea as inappropriate…  ·  Admin →

    0 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...

      Feedback and Knowledge Base