Hard to say exactly what this would look like with the info provided but I think you're on the right track. You most likely need another object representing the line Items. If I'm understanding correctly The solution would look something like this:
Each production would be connected One to many to a new child object: line items. (put the connection on the child object) Each of those children would connect to luMaterial and luStones. and include a text combo concat'ing those values.
Make the text combo field the display field on the child object.
Once that's done you can list the connected child values in a table/list that reads: 100% Silver, 9kt Yellow gold, Pearls. etc.
@dan you should be able to push anything via API, you just may need to poll a second view or object and package the data as an array before sending -checkout this example from webmerge. Hope this helps someone :)
//This code grabs data on the parent record from one view and the line items data from another and then sends to webmerge -where they can be used to create a table of the line items
//view 780 has line items -(whatever data you what you want to turn into a list or table)
//view_779 has the parent record data.
$(document).on('knack-scene-render.scene_393', function(event, scene) {
$('#view_782').append('<li><a href="#" id="webmerge" class="kn-button">Send Pro Forma Invoice</a></li>');
// link hander: Print Report
$('#webmerge').click(function(event) {
event.preventDefault();
// get data
var data = Knack.models['view_779'].toJSON();
var models = Knack.models['view_780'].data.models;
var lines = [];
for (var i = 0; i < models.length; i++) {
log(models[i].attributes);
lines.push({
itemid: models[i].attributes.field_641_raw,
vattotal: models[i].attributes.field_695_raw,
vatrate: models[i].attributes.field_694_raw,
brand: models[i].attributes.field_678_raw,
subtotal: models[i].attributes.field_642_raw,
producttype: models[i].attributes.field_677_raw,
quantity: models[i].attributes.field_634_raw,
price: models[i].attributes.field_635_raw,
linetotal: models[i].attributes.field_696_raw,
//fillingtype: models[i].attributes.field_638_raw[0].identifier
});
}
log('data!');
log(models);
log(data);
log(lines);
console.log("data is");
console.log(data);
console.log(lines);
Knack.showSpinner();
$.ajax({
url: 'https://www.webmerge.me/merge/yyyyyy/xxxxxxxxxxxxxxxx',
data: {
lines: lines,
invoicedate: data.field_670_raw,
salesrep: data.field_697_raw,
offerexpires: data.field_672_raw,
notes: data.field_632_raw,
terms: data.field_648_raw,
invoiceNum: data.field_617_raw,
customer_name: data.field_675_raw,
subtotal: data.field_644_raw,
total: data.field_693_raw,
vattotal: data.field_692_raw,
phone: data.field_699_raw,
email: data.field_705_raw,
address: data.field_700_raw,
contactname: data.field_698_raw,
salesemail: data.field_612_raw
},
type: 'POST',
success: function() {
console.log('Invoice Json sent to webmerge');
//alert("success");
Knack.hideSpinner();
},
error: function() {
alert('There was an error creating the invoice');
}
});
});
});