# How to: Resize Images from Fields

## Merge Field Syntax:

```
{{{!Object.fieldname__c replaceAll='#LT#img ,#LT#img height="Valuepx" width="Valuepx" '}}}
```

Take for example we generate an image stored in a rich text field:

<figure><img src="/files/Lf9iKMnjwqJO7CFplqGt" alt="" width="188"><figcaption></figcaption></figure>

The generated image is much too large. If we then generate setting the height and width to 100px and 50px:

```
{{{!Opportunity.Rich_text__c replaceAll='#LT#img ,#LT#img height="50px" width="100px" '}}}
```

<figure><img src="/files/028CUjjwptToGVA27r79" alt=""><figcaption></figcaption></figure>

***

## Related List Syntax:

Using the same example, we can alter the image within a related list using:

```
replaceall="<img ,<img style='width:100px'">
```

```html
<table>
<tbody>
<tr>
<th class="table498header">image test</th>
</tr>
</tbody>
<tbody style="page-break-inside: avoid !important; page-break-before: auto !important;"><!--{{!
<lineitemsSOQL>
<class>none</class>
<listname>opportunity</listname>
<soql>select rtfimage__c from opportunity where accountid = '{{!account.id}}'</soql>
<column type="rtf" replaceall="<img ,<img style='width:100px'">rtfimage__c</column>
</lineitemsSOQL>
}}-->
</tbody>
</table>
```

<figure><img src="/files/S9gwE4qtBhTfONwiF5Ki" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
NOTE: This will resize all images. max-width does not currently work at the time of this writing.
{% endhint %}


---

# 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/template-architecture/images-in-s-docs/dynamic-image-solutions/resize-images-in-rich-text-field.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.
