How to seperate look-up column values in each row in Microsoft List?

2024-01-10T02:52:10.1133333+00:00

Hello,

The new version of Microsoft List, for the lookup column, the values are now seperated by a colon "," by default (in the previous version, they are seperated in each row).

I would like to ask how we can set these values in order to display in each row?

Thank you.

User's image

User's image

Microsoft 365 and Office SharePoint For business Windows
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Xyza Xue_MSFT 30,176 Reputation points Microsoft External Staff
    2024-01-10T07:02:50.9966667+00:00

    Hi @Tran,Long_Thai (AH RA_PV_CO) BIA-VN-H ,

    Thank you for posting in this community.

    I tested this in my Microsoft List lookup column and they are separated in each row. User's image

    Does this happen with other lists? You could try to clear browser cache or use a different browser to see if the same error occurs.

    After my search, maybe you can use javascript and jquery. The code replaces the html coding of a semicolon with a html line break. It then copies the code and replaces the orginal code with it.

    $(document).ready(function(){
      $(".ms-vb:contains(';')").each(function(){
        var htmlstr = $(this).html();
        var htmlmod = htmlstr.replace(/; <A/g,"</br><A");
        $(this).html(htmlmod);
      });
    });
    
    
    

    Reference:https://sharepoint.stackexchange.com/questions/9042/replace-semicolon-delimiter-in-a-lookup-column-on-the-list-view

    Hope the information can help you. And if there have any unclear or misunderstanding, please feel free to post back and we’ll continue to help you all the time!

    Your understanding and patience will be highly appreciated! Hope you have a good day and keep safe!


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Tran,Long_Thai (AH RA_PV_CO) BIA-VN-H 100 Reputation points
    2024-01-10T07:09:08.42+00:00

    Hi @Xyza Xue_MSFT

    Thank you for your response. If the list is open in Sharepoint, the values are displayed in seperated rows. But if I open the list using Microsoft List app, it does not work.

    Also, could you please instruct me in details on how to use the code you provided?

    Thank you very much indeed.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.