I have a list named Department in which list item has a IconImage column which has publishingImage type. default this field is set to nothing and I want to update that field with image URL using rest.

Can anybody please help me?

I am able to retrieve that field data using FieldValueAsHtml but not able to update that field.

  • Thank you Rafael. Will try this and let u know if find any issue. Feb 7, 2017 at 3:54

2 Answers 2


Its not possible to update using REST, you can try below JSOM code to update its value:

1) Either when you have ID

function updatePublishingImage() {

    var clientContext = new SP.ClientContext(siteUrl);
    var oList = clientContext.get_web().get_lists().getByTitle('Pages');

    var oListItem = oList.getItemById(1);

    oListItem.set_item('PublishingPageImage',  "<img alt='abc image' src='/sites/test/PublishingImages/abc.jpg'>"); 


    console.log("updated image");
    console.log("something went wrong");

2) Or when you know the server relative url:

var ctx = SP.ClientContext.get_current(); 
var file = ctx.get_web().getFileByServerRelativeUrl(url);   

      function (file) {
    var listItem = file.get_listItemAllFields(); 
        listItem.set_item("PublishingPageImage","<img alt='abc image' src='/sites/test/PublishingImages/abc.jpg'>");    
          function () {
}, function(){
  • Are you sure it can't be done with the REST API? in my case I need to update the field from Power Automate, any ideas?
    – Geynen
    Jul 12, 2022 at 15:33

I believe that you can only update the publishing image field using CSOM or JSOM. Let me know if you need an example code of updating the publishing image field using JSOM.

  • Please share the example as it will be required to complete the answer Feb 6, 2017 at 16:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.