我目前有一个表单文本框,该数据存储在SharePoint列表中。
我有'客户名称'存储在名为' API_ClientName':
的SharePoint列表中
如何获取该客户端名称并在SharePoint列表的其他字段中预定义它?像这样:
代码:
function getItem() {
var item = {
Title: $("#ACI_client-name-input").val(), // Client Name
ACI_Email: $("admin@AD.com").val(), // NOT SURE EMAIL IS CORRECTLY FORMATTED TO BE STATIC
ACI_ClientName: $(" ").val(), // Account Name
ACI_Username: $(" ").val(), // Username
ACI_FirstName: $(" ").val(), // First Name
ACI_LastName: $(" ").val(), // Last Name
};
return item;
}
function AddListItem(resources) {
var item = getItem();
$pnp.setup({
baseUrl: "url..."
});
$pnp.sp.web.lists.getByTitle("MailChimpIntake").items.add(item).then(function(r){
$("#submit").hide();
$("#cancel").hide();
var newItem = r.data;
window.location = 'url...';
});

<div class="form-group row" style="margin-bottom: 15px;">
<label for="ACI_client-name-input" class="col-lg-10 col-form-label">Client Name</label>
<div class="col-lg-8">
<input class="form-control" type="text" id="ACI_client-name-input" placeholder="" required>
</div>
</div>
&#13;
答案 0 :(得分:0)
弄清楚了:
Title: $("#ACI_client-name-input").val(),
// Client Name ACI_AccountName: "FH " + $("#ACI_client-name-input").val(), ACI_Username: "fh" + $("#ACI_client-name-input").val(),
// Username ACI_FirstName: "....",
// First Name ACI_LastName: "...",
// Last Name ACI_Email: "....",
// Email