# Handle Escaped Characters in RENDER Statements

When using merge fields inside a render, if the merge field pulls in either `<` or `>`, the render will not properly work. This is because when the merge field pulls in `<` and `>` it pulls in the escaped version of these characters (`&lt;` `&gt;`). As of right now, we have a couple ways to work around this if it is needed.

### Workarounds

We currently have two workarounds that are confirmed to work.

{% stepper %}
{% step %}

#### Use replaceAll in the merge field

Use a replace all in the merge field replacing the escaped characters with nothing and updating the matching statement in the render to not include `<` or `>`.

Example:

{% code title="Example 1" %}

```
<!--RENDER='{{!Opportunity.nextstep replaceAll="&lt;, ,&gt;, "}}' != 'a href="/" target="_blank" /a'-->{{!Opportunity.nextstep}}<!--ENDRENDER-->
```

{% endcode %}
{% endstep %}

{% step %}

#### Use a named query to pull the data ahead of time

Use a named query to pull the data ahead of time and use the results from the named query in the render. This will avoid the characters getting escaped.

Example:

{% code title="Example 2" %}

```
<!--{{!<LineItemsSOQL>
<class>none</class>
<queryname>myQuery1</queryname>
<soql>
SELECT count(id) cid
FROM opportunity
where id = '{{!opportunity.id}}' and New_Line_Test__c = 'Test: <'
</soql>
</LineItemsSOQL>}}-->{{!myQuery1.cid}}<br />
<br />
Render Text if: <!--RENDER= {{!myQuery1.cid}} > 0 -->RENDER TEXT HERE <!--ENDRENDER-->
```

{% endcode %}
{% endstep %}
{% endstepper %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.sdocs.com/sdocs/advanced-template-logic/conditional-logic/handle-escaped-characters-in-render-statements.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
