英文:
Insert User through Sharepoint batch send HTTP Request Connector
问题
我需要使用SP连接器 - 发送HTTP请求将项目插入SharePoint。
我发送的主体内容是:"User": { "Key": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}" },
尽管它已成功创建,但SharePoint显示该字段没有数值。您知道可能出了什么问题吗?
英文:
I need to insert items into sharepoint by using SP connector - Send HTTP Request
I send body : "User": {
"Key": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}"
},
Despite it having successfully created, the sharepoint shows the field without value. Do you have any idea what could be going on?
答案1
得分: 1
在我这边复制后,我能够使用以下 JSON 在发送 HTTP 请求时使其工作。
{
"__metadata": { "type": "SP.Data.<YOUR_LIST_NAME>ListItem" },
"Title": "ccc",
"UserId": 6
}
UserId 是在我的 Sharepoint 中表示列的关键字,该列名为 User。请注意,如果在您的 Sharepoint 中列名为 Person,则确保将关键字值设置为 PersonId。
结果:
英文:
After reproducing from my end, I could able to make this work using the below JSON in the body while sending the HTTP request.
{
"__metadata": { "type": "SP.Data.<YOUR_LIST_NAME>ListItem" },
"Title": "ccc",
"UserId": 6
}
UserId is the key which represents the column in my Sharepoint which is named as User. Consider if Person is the column in your Sharepoint then make sure you set the key value as PersonId.
Results:
答案2
得分: 1
如果你看你的JSON:
"User":
{
"Key": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}"
}
你会注意到你只是发送了一个键到一个键值对目标。项目插入是因为提供了一个Key,但它不显示任何内容,因为你没有提供一个将要显示的Value。尝试使用以下JSON代替:
"User":
{
"Key": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}",
"Value": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}"
}
英文:
If you look at your JSON:
"User":
{
"Key": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}"
}
you'll notice that you're sending just a key to a key/value pair target. The item inserts because a Key is provided, but it doesn't display anything because you did not provide a Value that would be displayed. Try the following JSON instead:
"User":
{
"Key": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}",
"Value": "i:0#.f|membership|@{first(body('Get_by_mail')?['value'])['Email']}"
}
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论