if you use a html formula in a saved search, like ...
# ask-stanley-ai
m
if you use a html formula in a saved search, like CASE WHEN {field1} = 1 THEN '<p style="background-color:#D3F5C9">'||{field2}||' END and you export the search to excel, you get the html code in the html, not the value. is it possible to get the value instead of the html code in the excel export?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems that when you use a HTML formula in a saved search and export the search to Excel, the HTML code is included in the Excel file, not the value. This is because the HTML formatting is not recognized by Excel and is treated as plain text. To get the value instead of the HTML code, you can use a regular expression (regex) to remove the HTML tags from the field. In NetSuite, you can use the
REGEXP_REPLACE
function in a formula field to achieve this. Here is an example:
Copy code
REGEXP_REPLACE({field},'<[^<>]*>','')
This formula will replace all HTML tags in the
{field}
with an empty string, effectively removing them. However, this might not catch all HTML tags if they have attributes. In that case, you can use a more comprehensive regex pattern, like this one:
Copy code
<\\/?[\\w\\s\\/\"=]*>
This pattern will match any HTML tag, with or without attributes. Please note that this will only remove the HTML tags, not the CSS styles. If you have inline CSS styles in your HTML code, they will still be included in the Excel file. To remove them, you would need a more complex regex pattern, or you could preprocess the data before exporting it to Excel. ****** 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.86833632
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.834733903
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.833287895
Please provide your feedback on this answer.