# How to update a Rich Text and file field via API

**URL:** <https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639>\
**Category:** API & Programming\
**Created:** [October 23, 2024, 4:39pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639 "2024-10-23T16:39:25Z")\
**Posts on this page:** 19\
**Page:** 1

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 23, 2024, 4:39pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/1 "2024-10-23T16:39:25Z")

</div>

I am currently trying to figure out what is required to update a rich text field, i have the api call setup and is sending data but when i send in rich text from my Zoho Creator form, it shows up as

test

Also how do we use the api to update a File field

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/e/e1ab1675cd22ea70962be6d98ac4dc500ba3eb3e.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 23, 2024, 4:49pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/2 "2024-10-23T16:49:51Z")

</div>

> [@atran](#):
>
> when i send in rich text from my Zoho Creator form

How is the rich text being ‘sent’?

> [@atran](#):
>
> Also how do we use the api to update a File field

Check out the [guide](https://the.fibery.io/@public/User_Guide/Guide/File-API-265)

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 23, 2024, 5:04pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/3 "2024-10-23T17:04:29Z")

</div>

Looks like the rich text field in Zoho returns the text as this,

![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/d/df5ba0abb2749cf8d51b7c1f3dbea33357db2d80.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 23, 2024, 6:38pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/4 "2024-10-23T18:38:03Z")

</div>

If I understand the problem, it seems like the issue is that ZoHo is sending html, and Fibery is expecting markdown

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 23, 2024, 6:59pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/5 "2024-10-23T18:59:53Z")

</div>

Yeah is there anyway work around for this?

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [October 23, 2024, 8:23pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/6 "2024-10-23T20:23:49Z")

</div>

I’m not a zoho or zapier expert, so I’m not sure.

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 23, 2024, 8:35pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/7 "2024-10-23T20:35:23Z")

</div>

What are the API call(s) you are using? Can you show the code here?

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 24, 2024, 3:24pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/8 "2024-10-24T15:24:45Z")

</div>

{  
“command”: “create-or-update-documents”,  
“args”: [  
{  
“secret”: “xxxxxxxxx”, //secret of specific description field  
“content”: “xxxxx” // this would be the variable that stores the rich text from zoho  
}  
]  
}

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 24, 2024, 6:10pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/9 "2024-10-24T18:10:14Z")

</div>

> [@atran](#):
>
> create-or-update-documents

Did you try using `format=html` in the request URL?

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/66e7a352df688fb886f3637f8171beca538ebb93.png)

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 29, 2024, 3:28pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/10 "2024-10-29T15:28:44Z")

</div>

I tried that and it worked for normal text now, but if i add in rich text items in Zoho, it will send back for instance` <ul> and <ol>` for bulleted list which will cause nothing to be shown on fibery side

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/6/68f69ebdae540cbf7dbd89921a249a75f07e31fc.png)

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 29, 2024, 5:09pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/11 "2024-10-29T17:09:32Z")

</div>

> [@atran](#):
>
> which will cause nothing to be shown on fibery side

That doesn’t sound right 🤔  
Did you verify that the content being sent is valid HTML?

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 30, 2024, 3:39pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/12 "2024-10-30T15:39:41Z")

</div>

Here is the html from zoho  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/f/f3ea8450ae4b6c77d2ae4da47c7f08254ee63110.png)

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [October 30, 2024, 3:40pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/13 "2024-10-30T15:40:40Z")

</div>

Here is what is inputted in Zoho rich text field

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/d/da82d72677611f86922a6534613bd2d64ae13ad3.png)

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [October 30, 2024, 4:44pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/14 "2024-10-30T16:44:12Z")

</div>

I think you will need to engage Fibery Support for help with this issue, since only they can see what data has been passed to Fibery 😟

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 30, 2025, 11:59am UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/15 "2025-01-30T11:59:09Z")

</div>

I did a quick test with Fibery scripting

```auto
const fibery = context.getService('fibery');

for (const entity of args.currentEntities) {
    const content = '<div>Description<br/></div><ul dir="ltr"><li>Bullet 1<br/></li><li>Bullet 2</li></ul><div><br/></div>';
    await fibery.setDocumentContent(entity['Description']['Secret'], content, 'html');
}

```

and the output was rendered pretty much as I would expect:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/5/555234e4221321ea8e6616d35b7e15b087932ffe.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 30, 2025, 1:26pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/16 "2025-01-30T13:26:58Z")

</div>

I also tested via a POST to the documents API:

`https://acme.fibery.io/api/documents/commands?format=html`

```auto
{
  "command": "create-or-update-documents",
  "args": [
    {
      "secret": "91dc8478-1a3c-4b1a-9ba1-2d57a32ad6b1",
      "content": "<div>Description<br/></div><ul dir=\"ltr\"><li>Bullet 1<br/></li><li>Bullet 2</li></ul><div><br/></div>"
    }
  ]
}

```

and the result was the same.

However, note that I had to escape the double quote in the `<ul dir="ltr">` part since JSON does not like double quotes in a string.

I suggest you check if the content is being correctly JSON encoded.

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [January 30, 2025, 4:49pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/17 "2025-01-30T16:49:47Z")

</div>

Note that it is also valid HTML to use single-quotes instead of double-quotes for parameter values - hopefully Fibery can handle this variation.

E.g.,

```auto
"content": "<div>Description<br/></div><ul dir='ltr'> ..."

```

---

<div class="post-metadata">

**Author:** ![atran](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@atran](https://community.fibery.io/u/atran)\
**Post date:** [February 19, 2025, 5:26pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/18 "2025-02-19T17:26:59Z")

</div>

This worked for me, using single quotes

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [February 19, 2025, 5:48pm UTC](https://community.fibery.io/t/how-to-update-a-rich-text-and-file-field-via-api/7639/19 "2025-02-19T17:48:25Z")

</div>


