Advertisements

Microsoft Flow – Update a Hyperlink or Picture field

When you use flow to update list items it is  quite easy to update test fields, however one of the issues I ran into today was to update a picture column.

 

As part of my flow that collects the updates for the available Microsoft Flow connectors, I’m creating list items.

 

Unfortunately the Update item or Create Item actions do not show the picture columns. I managed to create a text field but that will just show up as the url of the hyperlink. I my case I want the icons to appear instead.

As so often the Send HTTP request to SharePoint comes to the rescue.

Advertisements

17 thoughts on “Microsoft Flow – Update a Hyperlink or Picture field

  1. commented on March 25, 2019 by Asri Zainal

    Hi,

    Would you be able to explain more how you achieve this?

    I’m working on a project that requires updating a sharepoint list picture column data from Powerapps or Microsoft Flow. We are using SPO O365.

  2. commented on May 23, 2019 by PA

    This is exactly what I was looking for. I do not know much JSON and I get an error “Not well formatted JSON stream.”

    I am typing in the Body section of the HTTP action exactly as was posted on this page. What am I missing or doing wrong?

    In the flow history log it shows this HTTP call:

    {‘__metadata’:{‘type’:’SP.Data.ConnectorsListItem’}.’Icon’:
    { ‘Description’: ‘Icon’,
    ‘Url’: ‘(here it shows PNG non-text output)’
    }
    }

    Do I have to change “icon” to the name of one of my columns?

  3. commented on May 28, 2019 by PA

    Okay, I sent you some screenshots. I fixed the first error but encountered another.

    The ‘not well formatted JSON’ error was probably caused by the Headers not being correct. In your screen shot, there was not a line between 2 of the headers, butit seems that there should be.

  4. commented on June 4, 2019 by Rami Daoud

    I have an attachment column contains a url of an image. (this has been created by the attachment control of powerapps) and I want to update the picture type column with the url in the attachment. how can this be done?

  5. commented on June 18, 2019 by PA

    I fixed my original ‘not well formatted JSON’ error by fixing the headers (there should be lines in between, even though they do not appear in the screenshots), but encountered another problem. The new error is, “A type named ‘SP.Data.ConnectorsListItem’ could not be resolved by the model. When a model is available, each type name must resolve to a valid type.”

    To simplify the testing, I removed the addition of the icon and focused only on updating the Summary.

    {‘__metadata’:{‘type’:’SP.Data.ConnectorsListItem’},
    ‘Summary’: “This test worked”
    }

    • commented on June 19, 2019 by Pieter Veenstra

      The type will need to be adjusted to match the list name. My list was callled Connectors, hence the type I used.

  6. commented on September 18, 2019 by K G Amar

    Hello,

    When I try the same in our environment, getting the below error.

    “status”: 400,
    “message”: “Invalid JSON. A comma character ‘,’ was expected in scope ‘Object’. Every two elements in an array and properties of an object must be separated by commas.\r\nclientRequestId: 774470e9-9bd4-493c-916e-a3d6f1f7dcf9\r\nserviceRequestId: 7e70059f-101f-9000-7a74-5933827c0e95”,

    Could you please help me getting this error fixed?

  7. commented on December 13, 2019 by Lisa

    Hi Pieter,

    I’m getting this error message as at below:-
    “message”: “The property ‘__metadata’ does not exist on type ‘SP.Data.Spot_x0020_listListItem’. Make sure to only use property names that are defined by the type.\r\nclientRequestId: ab710f58-0b71-4164-bac3-d92ce48182f3\r\nserviceRequestId: af0c219f-d04b-0000-480e-c2ee97236b5e”,
    “status”: 400″

    Could you please help me to find the root cause?
    I have emailed you the screenshots.

    Thank you.

    • Can you go to the REST API url in your browser. Then search for SP.Data and check that the type is exactly correct.

      • commented on December 16, 2019 by Lisa

        Yes. I have checked it. it is correct. SP.Data.Spot_x0020_listListItem

      • Hi Lisa,
        It looks like the http request isn’t recognising the verbose mode. Can you check if there is a space or anything else after the ; in the Content-type? A space works and I think that you can even do this without a space there.

      • commented on December 16, 2019 by Lisa

        Hi Pieter, I have solved my problem. I changes my coding in body as:
        {
        ‘__metadata’: {‘type’:’SP.Data.Spot_x0020_listListItem’},
        ‘QRCodeGenerator’ :
        {
        ‘__metadata’: {‘type’:’SP.FieldUrlValue’},
        ‘Description’: ‘httpxxxxxx’)}’,
        ‘Url’: ‘httpxxxxx’)}’
        }
        }

        And it’s work!

  8. commented on December 16, 2019 by Lisa

    Hi Pieter, you are right! I checked again the Headers from my failed log. it’s my typo error, previously i wrote as “Content_Type” instead of “Content-Type”.

    Thank you very much Pieter. I will keep follow your blog. It’s really help me a lot! Cheers~ 🙂

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: