简体   繁体   English

使用Microsoft Flow按顺序将SharePoint列表中的行插入Excel

[英]Insert Rows from SharePoint List into Excel in Order Using Microsoft Flow

I need to create an excel document daily that captures any changes to a SharePoint list. 我需要每天创建一个Excel文档,以捕获对SharePoint列表的所有更改。

The list on SharePoint contains the columns 'vendor' / 'product' / 'promotion' and is sorted by vendor first, and product second. SharePoint上的列表包含“供应商” /“产品” /“促销”列,并按供应商第一,其次是产品进行排序。

Using the 'Get Items' SharePoint connector to feed 'Insert Rows' Excel connector is yielding the correct result, except that it is not putting the items in the order they are displayed on the SP list (sorted by vendor, then product). 使用“获取项目” SharePoint连接器来馈送“插入行” Excel连接器会产生正确的结果,不同的是,它不会按SP列表中显示的顺序排列项目(按供应商,然后按产品排序)。 It is adding them to excel in the order they were added to the sharepoint list (IE The last addition to the sharepoint list is last on the excel table). 它将按添加到共享点列表的顺序将它们添加到excel(IE,共享点列表的最后添加是excel表上的最后一个)。

I am using insert row instead of create table or create worksheet because the formating of the cells must be maintained. 我使用插入行而不是创建表或创建工作表,因为必须保持单元格的格式。 By leaving the first cell in my template intact and deleting all of the old entries before getting the updated ones, the formatting is preserved. 通过保留模板中的第一个单元格不变并删除所有旧条目,然后再获取更新的条目,可以保留格式。

There are actions updstream and downstream within my flow that I would like to preserve, so using an alternative solution to Flow is not ideal. 我想保留流中上游和下游的动作,因此对Flow使用替代解决方案并不理想。

Is there a way to bring the sharepoint row items in order? 有没有一种方法可以按顺序排列共享点行项目?

There was two factors mitigating the results of my flow: 有两个因素会影响我的流程结果:

1) There seems to be some bug that if you do not "Filter By" the items, applying an "Order By" paramater wraps the action in an apply to each, which is unworkable. 1)似乎存在一些错误,即如果您不对项目进行“筛选依据”,则应用“订购依据”参数会将操作包装在对每个项目的应用中,这是行不通的。

2) Looking at the server responses from the Flow report, I noticed that the Display names of some of the columns in my SharepPoint List were not the same as my column header. 2)在查看Flow报告中的服务器响应时,我注意到SharepPoint列表中某些列的显示名称与我的列标题不同。 In my case, I renamed "Title" to "Partner", but it was still being identified as "Title", despite not displaying this in Sharepoint. 就我而言,我将“标题”重命名为“合作伙伴”,尽管它没有在Sharepoint中显示,但仍被标识为“标题”。

Overall solution was to 1) put a dummy filter in that grabbed everything in the Get Items action: "Title ne 'x'" (remove " marks when using in Filter By, means Title not equal 'x'), and 2)Using "Title asc" in Order By. 总体解决方案是:1)将一个虚拟过滤器放入其中,以获取Get Items操作中的所有内容:“ Title ne'x'”(在Filter By中使用时删除“标记,表示标题不等于'x'),以及2)使用Order By中的“ Title asc”。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM