How can I get Headers data from Lookup in result m...
# ask-stanley-ai
a
How can I get Headers data from Lookup in result mapping?
c
AI generated answer (using internal Slack threads):
To get the headers data from Lookup in result mapping, you can use the
column.label
property. This property will give you the label of the column, which is the header in the context of a saved search. Here is an example of how you can modify your code to get the column labels:
Copy code
javascript
var searchData = [];
savedSearch.run().each(function(result) {
    var rowData = {};
    savedSearch.columns.forEach(function(column) {
        rowData[column.label] = result.getValue(column);
        rowData[column.label + '_text'] = result.getText(column);
    });
    log.debug('Search Result', rowData);
    searchData.push(result);
    return true;
});
In this code,
column.label
is used instead of
column.name
to get the column headers. This will give you the labels (headers) of the columns instead of their internal names. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806444
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.791099846
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.786844373
Please provide your feedback on this answer.
Thank you for your feedback