Can the "contains" function recognize website info errors?

Hi! Curious if the contains function can recognize when this website selector produces an error. Rather than pasting an error all over my page, I wanted to just have it skip over it. Below is what I was trying to do to make it work but I get the full error message posted regardless as though the if function is using the "else" output.

{sales_rep={site: text; page=https://renewalbyandersen.lightning.force.com/*; select=ifneeded; selector=[field-label="Sales\ Rep"] .word-break-ie11}} {if: contains(sales_rep, "No match found")} Error {else} {=sales_rep}{endif}

Hi Nathan,

contains() will not work with errors. You can use the catch() function to achieve this:

{sales_rep=catch({site: text; page=https://renewalbyandersen.lightning.force.com/*; select=ifneeded; selector=[field-label="Sales\ Rep"] .word-break-ie11}, "No match found")}
{=sales_rep}

Let me know if it works for you.

1 Like

This worked!