如何在 SharePoint 2013 设计器工作流中执行循环遍历列表项? [英] How to perform Looping Through List Items in SharePoint 2013 Designer Workflows?

查看:46
本文介绍了如何在 SharePoint 2013 设计器工作流中执行循环遍历列表项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 SharePoint 的新手.我正在 SharePoint 2013 中创建一个工作流,我想在其中使用循环迭代列表.如何在 SharePoint 2013 设计器工作流中执行列表项循环?

I am new to SharePoint. I'm creating a workflow in SharePoint 2013 in which I want to iterate a List using a loop. How to perform looping through list items in SharePoint 2013 Designer Workflows?

推荐答案

您可以在 SharePoint 2013 中(仅限!)使用新的HTTP Web 服务"执行此操作.诀窍"是

You can do this in SharePoint 2013 (ONLY!) using the new "HTTP web service". The "trick" is to

  1. 创建一个将调用 HTTP Web 服务并调用.../client.svc/web/lists/getbyid()/items"的任务
  2. 在(2013 年新增的!)字典"变量中返回 (JSON) 结果
  3. 使用从字典中获取项目"操作
    • 按名称或路径列出的项目"并输入d/results"
    • 选择字典"变量(您在其中捕获结果)
    • 输出到另一个字典变量(称之为数据")
  1. Create a task that will call the HTTP Web Service and call ".../client.svc/web/lists/getbyid(<List Guid>)/items"
  2. Return the (JSON) results in a (new in 2013 also!) "dictionary" variable
  3. Use the "Get an Item from a Dictionary" action
    • "item by name or path" and enter "d/results"
    • select the "dictionary" variable (that you captured the results in)
    • output to another dictionary variable (call it "data")

对于循环",您将使用带条件的循环";使用名为index"的变量并将其设置为 0.循环条件"直到index

For the "loop" you will use the "Loop with condition"; use a variable called "index" and set it to 0. "Loop with condition" until "index < totalItems"

在循环体中:

  1. 从字典中获取项目"使用按名称或路径的项目"
  2. 使用字符串构建器d/results/()/".要检索的列名"将是您要评估的任何列(例如DueDate").

    注意:您必须使用列的静态名称",可以通过转到任务列表设置"并单击列名称来找到该名称,然后在 URL 中找到字段=" 部分.. 您将使用的就是 "".
  1. "Get an item from a dictionary" use "item by name or path"
  2. using string builder "d/results/(<index>)/". The "Column Name to Retrieve" will be whatever column(s) you want to evaluate (like maybe "DueDate").

    Note: You will have to use the "Static Name" of the column, which can be found by going to the Task List Settings and clicking the name of the column, then in the URL find the "Field=<Name>" portion.. It is that "<Name>" that you will use.

<小时>

我知道这对很多用户来说非常粗鲁,甚至可能接近无用",但我觉得我至少应该尝试快速回复.当我有更多时间时,我会尝试编辑它并更好地格式化我的回复.虽然,我发现这个是因为有类似的需求,并且因为我找到了一种方法来完成我所需要的,我觉得至少在我可用的有限时间内尽可能地分享它.;) 所以,也许有人会发现我试图描述的有用".:)


I know this is very CRUDE maybe even bordering on "useless" for alot of users, but I felt I should at least attempt a quick reply. When I have more time, I will try to edit this and format my reply better. Although, I found this because of a similar need and since I figured out a way to accomplish what I was needing, I felt compelled to at least share it the best I could, in the limited time I had available. ;) So, maybe SOMEONE will find what I have attempted to describe, "useful". :)

这篇关于如何在 SharePoint 2013 设计器工作流中执行循环遍历列表项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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