更新列表和库控件中的总数

问题描述

我想在添加记录时将数字字段和查找字段相乘。我可以使用常规记录来执行此操作(如您在下面的情况中所看到的,其中QTY​​ *项目值是总数。但是我想将QTY字段乘以Hardware:Price。

enter image description here

请参见下面的代码

window.myFunction = function() {
//if (confirm('Are you sure you wish to add this item to Cart?')) {
var myItem = fd.field('Item').value.LookupValue;
var myValue = fd.field('ItemValue').value;
var myQty = fd.field('QTY').value;
var myId = fd.field('Item').value.LookupId;
var myItemCost = myValue * myQty;
var list = pnp.sp.web.lists.getByTitle("ITD-EFS-030A Hardware Details");
var id = list.items.add({
HardwareId: myId,QTY: myQty,Estimatedcost: myValue,Total: myItemCost
}).then(function(){
//console.log("Updated!");
// alert(id);
fd.control('SPDataTable1').refresh();
// list.items.
});
}

解决方法

您可以使用Microsoft Flow来实现。

这些是演示:

  1. https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/Update-a-secondary-SharePoint-list-using-Flow/ba-p/38201
  2. https://prairiedeveloper.com/2018/10/updating-a-list-item-from-microsoft-flow/