I have an array of field names and an array of objects which contain all properties of fields for a module.
Given the fields1, how can i search in fields2 and take some other properties for this fields using javascript(basically i want to output fields3)?
const fields1 = ['analysis', 'casecreator'];
const fields2 = [
{
name: "analysis",
label: "Analysis8D",
mandatory: false,
uitype: "10",
},
{
name: "automatic_close",
label: "Automatic Close",
mandatory: false,
uitype: "56",
},
{
name: "casecreator",
label: "Case Creator",
mandatory: false,
uitype: "2",
}
]
const fields3 = [
{
name:"Analysis8D",
uitype: "10"
},
{
name:"Case Creator",
uitype: "2"
}
]