Using If then for click related command errors

I utilize a PIMS cloud based software for my veterinary medical records. I have begun incorporating click commands to automatically generate programmed follow up calls for my patients at a certain time depending on the problem. However, the software engineers have many different SOAP formats for different appointment types that all have a different CSS identity for the item I want to identify to click.
Is there a way for me to handle errors when a certain CSS item cannot be clicked and have the snippet try to execute another one automatically before giving up and telling me that it failed?

Hi @Genevieve_Hoffman, welcome to the forum. :slight_smile:

Unfortunately, the snippet stops with an error once it's unable to click on the element. However, I'd recommend you use a different approach. As each SOAP format has a different CSS identity, you may first try to read some discriminator data from the page (with a fixed selector) to identify which SOAP format it is. Then, use if/else conditions to execute the {click} command on the correct CSS identity.

Example:

{soap_format={site: text; selector=#soap-type-selector}}
{if: soap_format="value1"}
{click: selector=#element-1}
{elseif: soap_format="value2"}
{click: selector=#element-2}
{endif}

Let me know if that helps.