Skip to main content
mohdk0002
November 30, 2022
Solved

Adding multiple links in links field but its opening as single link

  • November 30, 2022
  • 8 replies
  • 3 views

Hi,

I have created an interface where I am tracking some details which even has a Links column so I have created a paragraph/text field to receive the user's inputs (External URL links), now after the links are inserted, submitted, and saved. I am showing them up on a Record view using the links field > a!safeLink.

If one link is updated by a user then it's okay its working fine and opens the window in a new tab see image 1:

But if a user is updating more than 1 link then it's not differentiating between multiple links and assuming the entire entry as a single link, I tried using commas, semi color between links but nothing is working, see below:

Could someone please help me with this?

Best,

Mohammed Khaiserulla

    Best answer by karthikr067273

    Hi Mohammed,

    The following code snippet should be working,

    a!gridColumn(
      label: "Links",
      sortField: 'recordType!LA Record Link.fields.links',
      value: a!richTextDisplayField(
        label: "Real Links",
        value: a!forEach(
          items: split(fv!row['recordType!LA Record Link.fields.links'], ";"),
          expression: a!richTextItem(
            text: fv!item & char(10),
            link: a!safeLink(
              uri: fv!item,
              openLinkIn: "NEW_TAB"
            ),
            linkStyle: "STANDALONE"
          )
        )
      )
    )

    And it is working for me,

    Maybe you need to refactor the code based on your requirement.
    Thanks

    8 replies

    harshitb6843
    November 30, 2022

    You should use a!richTextDisplayField and then add char(10) between the different rich text items to differentiate. 
    Once done, you will be able to add individual links on each item using a!safeLink() and they will be available as separate links. 

    mikes0011
    Brainy
    November 30, 2022

    Seconded.  Nobody should be using a!linkField() nowadays, under any condition. I'm not sure why they haven't just deprecated it, TBH.

    The Expression Guru