Hi All,
I was working with the toolbox plugin and I have to say I am very impressed with the list item expression function. Great job @mishav!
I have a question about whether or not something I am trying to do is possible for this. For example, lets say that I have a data structure that looks like the following:
{
"composite": {
"name": "Material X",
"layers": {
"layer1": {
"amount": 12,
"type": {
"name": "polycarbonate A",
"subcomponents": {
"subcomponent1": {
"name": "sodium hydroxide",
"amount": 30
},
"subcomponent2": {
"name": "diphenoxide",
"amount": 8
}
}
}
},
"layer2": {
"amount": 10,
"type": {
"name": "polycarbonate B",
"subcomponents": {
"subcomponent1": {
"name": "sodium hydroxide",
"amount": 26
},
"subcomponent2": {
"name": "diphenoxide",
"amount": 9
}
}
}
}
}
}
}
Composites are composed of layers in varying amounts. There are situations in which a user would like to see the total amount of a particular subcomponent of all layers in a composite material. For instance, the amount of sodium hydroxide in Material X. Different composites have varying amounts of layer, which have different amounts of subcomponents, which are stored as items in a list. What I ultimately would like to do is multiply the amount of the sub component in a unit of the layer, by the amount of the layer that is in a given composite, and then to retrieve the sum for all layers. Something like this:
Thing: Do a search for Composites
list expression = field(“layers”, “amount”) * field(“layers”, “type”,“subcomponents”,“amount”)
list expression:sum
The problem is, I am unable to filter the subcomponents by name as far as I can tell. I.e. sometimes, one would want the total amount of sodium hydroxide and other time they would want the total amount of diphenhydride.
I would appreciate any thoughts on whether or not this is possible and how I would go about doing this.