darrenhillconsulting
06/01/2021, 5:36 PMformula fields in Map/Reduces are a big no no?stalbert
06/01/2021, 5:54 PMlabel on the columns, do they come through unscathed into map()?Sandii
06/01/2021, 5:54 PMstalbert
06/01/2021, 5:55 PMstalbert
06/01/2021, 5:56 PMstalbert
06/01/2021, 5:57 PMSandii
06/01/2021, 5:57 PMstalbert
06/01/2021, 5:57 PMSandii
06/01/2021, 6:01 PMcolumns: [
search.createColumn({
name: 'formulatext_0',
formula: '{entity}',
}),
search.createColumn({
name: 'formulatext_1',
formula: '{subsidiary}'
})
]Sandii
06/01/2021, 6:02 PMname: 'formulatext', when it gets to map result.values.formulatext will only be the second one if I remember correctlystalbert
06/01/2021, 6:03 PMname property acts as a label?Sandii
06/01/2021, 6:04 PMstalbert
06/01/2021, 6:05 PMstalbert
06/01/2021, 6:05 PMnsSearchResult2obj()stalbert
06/01/2021, 6:05 PMasMappedResults() native method does the same IIRC?Sandii
06/01/2021, 6:05 PMstalbert
06/01/2021, 6:05 PMasMappedResults() will return labels as the object keys if set.Sandii
06/01/2021, 6:07 PM.columns property is there (which has the label), but you cannot use .getValue() in conjunction with labels. And toJSON() on the result line sees the labels go away completely.Sandii
06/01/2021, 6:13 PMasMappedResults uses the alias property in query, and I believe that is translated properly between getInput and mapstalbert
06/01/2021, 6:16 PMnsSearchResult2obj cleanly handles normal search.Result objects, using labels if present, if not falling back to the column name.stalbert
06/01/2021, 6:17 PMSandii
06/01/2021, 6:17 PMgetInput and map if you just return a created search in an MRstalbert
06/01/2021, 6:18 PMstalbert
06/01/2021, 6:19 PMstalbert
06/01/2021, 6:20 PMSandii
06/01/2021, 6:23 PMquery.create() syntax does respect the alias param on the columns when passing down the mapalien4u
06/01/2021, 7:37 PMvar aColumns = [];
var oColumnsDefinition = {};
for (var sKey in COLUMNS_MAP) {
oColumnsDefinition[sKey] = search.createColumn(COLUMNS_MAP[sKey]);
aColumns.push(oColumnsDefinition[sKey]);
}alien4u
06/01/2021, 7:37 PMalien4u
06/01/2021, 7:38 PMconst columns = [...Object.keys(oColumnsMap).map(sColumn => search.createColumn(oColumnsMap[sColumn]))];