0

I would like to multiply a numeric field and lookup field upon adding the record. i can do this with normal record (as you see in the case below, where QTY * Item Value is the total. But i would like to multiply the QTY field with Hardware:Price.

enter image description here

Please see the code below

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.
});
}
Rinu
  • 354
  • 2
  • 6
  • 18

1 Answers1

0

You could use Microsoft Flow to achieve this.

These are demos:

  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/
Amos
  • 2,030
  • 1
  • 5
  • 9