SPD2013工作流程:使用REST一次更新多个项目 [英] SPD2013 Workflow: Use REST to Update multiple items at once

查看:100
本文介绍了SPD2013工作流程:使用REST一次更新多个项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我大约有9个列表.列表是控制列表,另一个是数据输入列表.当控制列表中的状态更改时,子列表中的状态需要更新.此更新是根据控制列表"中的字段进行的,即 匹配子列表中的值.

I have about 9 lists. Once list is a control list, and the other are data entry lists.  When the status in the Control List is changed, then the status in the child lists needs to be updated. This update occurs based on fields in the Control List, that match values in the Child lists.

该博客非常适合设置对单个项目的单个字段执行更新所需的POST.
http://blog.ch.atosconsulting.com/updating-list-items-using-sharepoint-2013-workflow-engine/

This blog was pretty good for setting up the POST needed to perform an Update on a single field on a single item. 
http://blog.ch.atosconsulting.com/updating-list-items-using-sharepoint-2013-workflow-engine/

我的子列表在每个列表中都会有多个项目,并且此博客并未明确说明如何形成URL.它显示:
     http://< yourserver>/< yoursite>/_api/web/lists/getByTitle(‘< yourlist>’)/Items(< itemid>)

My child lists will all have multiple items in each list, and this blog doesn't make it clear as how to form the URL. It shows:
     http://<yourserver>/<yoursite>/_api/web/lists/getByTitle(‘<yourlist>’)/Items(<itemid>)

我有一个列表,其中包含子列表的名称,并将遍历该列表以获取列表名称和SP.Data类别名称.我希望可以在URI中添加查询过滤条件,以便仅返回某些项(基于匹配值) 在控制列表中),然后我可以发出一个POST来更新所有记录.

I have a list that holds the names of the child lists, and will loop through it to get the list name and SP.Data Category name. I am hoping that I can add query filter criteria in my URI, such that only certain items are returned (based on matching values in the control list), and that I can issue a single POST to update all the records.

这个问题的原因是他有.../Items(< itemid>),我必须对子项列表中的每条记录进行逐一推断.

The reason for this question is that he has .../Items(<itemid>), which sort of infers that I have to do each record in the child list one by one. 

那么,我可以发出带有查询过滤条件的URI,并立即对所有返回的记录执行POST操作吗?

So, can I issue a URI, with query filter criteria, and perform a POST operation against all of the returned records at once?

如果不是,那么< itemid>的确切含义是什么?这是返回的商品之一的内置ID吗?

If not, then exactly what is expected for <itemid>? Is this the built-in ID of just one of the returned items? 

预先感谢

推荐答案

>因此,我可以发出带有查询过滤条件的URI,并立即对所有返回的记录执行POST操作吗?

> So, can I issue a URI, with query filter criteria, and perform a POST operation against all of the returned records at once?

不仅仅是REST PUT或MERGE.他们一次只能更新一项.您应该能够使用CAML查询进行多个更新,而这些查询可以使用RESTrequest提交. CAML是您首先需要在工作流中构建的XML字符串. 我说应该",但找不到适合您的示例.

Not with just a REST PUT or MERGE. They only update one item at a time. You should be able to make multiple updates using a CAML query, which can be submitted using a RESTrequest. CAML is an XML string that you would first need to build in the workflow. I say "should", but I can't find an example to show you.

这篇文章显示了如何使用REST发送CAML,但仅作为查询而不是更新. https://www.codeproject.com/Tips/1181172/SharePoint-REST-API-CAML-Query

This post shows how to send CAML using REST, but only as a query, not an update. https://www.codeproject.com/Tips/1181172/SharePoint-REST-API-CAML-Query

这可能有一个更新示例:https://github.com/andrewconnell/sp-o365-rest/tree/master/SpRestBatchSampl e

This may have an example of updating: https://github.com/andrewconnell/sp-o365-rest/tree/master/SpRestBatchSample

其他可能性:https://www.google.com/search?q=sharepoint+%2Brest+update+multiple+items

Other possibilities: https://www.google.com/search?q=sharepoint+%2Brest+update+multiple+items

>如果不是,那么< itemid>到底期望什么?这是返回的商品之一的内置ID吗?

> If not, then exactly what is expected for <itemid>? Is this the built-in ID of just one of the returned items?

SharePoint的内部ID.编辑任何列表的视图,您将找到ID属性.

SharePoint's internal ID. Edit the view of any list and you will find the ID property.


这篇关于SPD2013工作流程:使用REST一次更新多个项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆