【问题标题】:How to merge data from a query with two separate collections?如何将查询中的数据与两个单独的集合合并?
【发布时间】:2021-06-18 01:24:09
【问题描述】:

我在屏幕上有两个画廊,我正在尝试将来自查询 (datSavedWipDetails) 的数据合并到这两个画廊中显示的集合数据中。我正在遍历 datSavedWipDetails 中的项目并尝试更新指定部分集合中的正确项目,但我显然做错了。

补丁对我来说似乎是错误的。我遇到了一些问题,有时它有时会起作用,有时却不起作用。我发现 UpdateIf 在大多数情况下更可靠。

/* Iterate over datSavedWipDetails and incorporate with top & bottom galleries  */
If(CountRows(datSavedWipDetails) <> 0, 

  ForAll(datSavedWipDetails, 
    UpdateIf(Filter(colItemsInTopDisplay, wipProductCodeID = ThisRecord.ProductCodeID), wipDisplaySection = "Top",{ItemSCQty: wipItemSCQty });
    UpdateIf(Filter(colItemsInBottomDisplay, wipProductCodeID = ThisRecord.ProductCodeID), wipDisplaySection = "Bottom" ,{SCQty: wipItemSCQty })
  );
  /* End ForAll */ 
 , false);
/* End If */    

这是在更新集合,但更新不会反映在显示中。有什么想法吗?

【问题讨论】:

    标签: powerapps


    【解决方案1】:

    想通了。我需要像这样删除过滤器并在 UpdateIf 语句中使用该过滤条件...

      ForAll(datSavedWipDetails, 
        UpdateIf(colChgReqSCReview, wipDisplaySection = "Top" && wipProductCodeID = ProductCodeID, {ItemSCQty: wipItemSCQty });
        UpdateIf(colSCSkusForNewOrder, wipDisplaySection = "Bottom" && wipProductCodeID = ProductCodeID, {SCQty: wipItemSCQty });
      );
    

    【讨论】:

      猜你喜欢
      • 2019-07-25
      • 1970-01-01
      • 2014-06-08
      • 2015-09-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-03-12
      相关资源
      最近更新 更多