Forum Discussion

Henning Strand's avatar
Henning Strand
Brass Contributor
Jun 14, 2018

Updating a Hyperlink field (both url and description) using Flow?

I tried using the update item action to set a Hyperlink type column in my custom list. The Flow field for this column only accepts the url so there seems to be no way to add the description part. Anyone got this working?

 

In SharePoint:

 

In Flow:

  • Jason H's avatar
    Jason H
    Copper Contributor

     

    I too found updating the hyperlink description much harder than it should be.  The best solution that worked for me is detailed below.

     

    I had a client ask for the ability to export individual items to Excel.  SPO export function by default exports all items so long story short I ended up using Flow.  I used the below action to update the URL to the CSV file and changed the display name to "CSV"

     

    TestURL2 is the column name

     

    • Marianne Chalupt's avatar
      Marianne Chalupt
      Copper Contributor

      Hi,

      I have tried your solution, but I have an code error 412. 

      message""La valeur «  » ETag de la demande ne correspond pas à la valeur « \"4\" » ETag de l'objet.

       The message are in french  ,but that said : Etag Request doesn't match to value 4 of the Etag Object.

      Please can you help me?

       

      • Parmi MEHTA's avatar
        Parmi MEHTA
        Copper Contributor
        unfortunately taxonomy values are not yet supported in Flow for tagging. it does not work.
    • Deleted's avatar
      Deleted
      Hi Jason, For me, it was bit complicated that my site name and list name contain some spaces. But, it just works fine. Thanks. Masahiro
      • Jason H's avatar
        Jason H
        Copper Contributor

        Deleted wrote:
        Hi Jason, For me, it was bit complicated that my site name and list name contain some spaces. But, it just works fine. Thanks. Masahiro

        I'm glad that worked for you Masahiro.  Yes spaces are nasty and I try to avoid them if I can :)

    • Chintan123's avatar
      Chintan123
      Copper Contributor
      Jason - there is a correction in your screenshot. YOu need to correct it to avoid confusion by reader.
      Body Text is as follow:-
      {'__metadata': {'type':'SP.Data.TaskListItem'},
      'InternalFieldName':{'Description': 'Click Here','Url': 'siteUrl/sites/site1/Lists/Task/DispForm.aspx?ID=1'}
      }
      if your list name is "abc" then type value should be "SP.Data.abcListItem".
      Field name should be Internal field name and not display name.
  • CXRL--'s avatar
    CXRL--
    Copper Contributor

    Henning Strand

     

    A co-worker and I found a work-around. We are not updating both parts of the Hyperlink field, but this works nicely as an alternative.

     

    Instead of a hyperlink field, we use a Multiple Lines of Text field with the text type set to "Enhanced Rich Text". In the flow, we insert something like this into the field:

     

    <a target="_blank" href="[CURRENT ITEM:URL]">[CURRENT ITEM:URL PREVIEW]</a>

     

    [CURRENT ITEM:URL] and [CURRENT ITEM:ID] are the dynamic content. The result is a link that appears in the list, under whatever column you chose.

     

    This method has the downside of being less user friendly (unless you hide the field in the New Item/Edit Item forms), but I find it simple and reliable.

     

    A note to any Microsoft moderators reading this: I realize that this could potentially be abused to inject code into a list. If something must be done about it, I humbly request that either A) certain DOM elements are white-listed or black-listed as necessary, so that some part of this functionality will survive, or B) the functionality to resolve OP's question is implemented.

    • _KarlH's avatar
      _KarlH
      Brass Contributor

      CXRL-- That Rich Text works well, thanks so much for sharing. 

       

      We were struggling with URL Text not displaying correctly within the Calendar View - but thankfully Rich Text fields do work well with the Calendar View. 

  • Set the value to "URL, Description" without quotes, has to have URL then comma then a space after comma then Description.

    • Henning Strand's avatar
      Henning Strand
      Brass Contributor

      Thanks, but that is what I tried and that did not work. As you see from my attached image with "http://www.cnn.com, CNN" (without quotes), I get an error saying to add a proper URI. Or did I misunderstand you?

    • mo_mkf's avatar
      mo_mkf
      Copper Contributor

      Hey danmitchell36,

       

      Thanks for the link, I gave yours a try, but got this error:

       

      Not well formatted JSON stream.
      clientRequestId: 865768ab-bec3-44ed-a436-fb15aa25cd69
      serviceRequestId: a805c99e-a06d-8000-aa83-4de13cfb3351

       

      Thanks

Resources