Lists - Format Form JSON to get (People or Group)

Bahaa86 0 Reputation points
2023-04-29T21:54:45.88+00:00
Hello,

I am trying to customize the header in my Microsoft List's form, and I cannot get the value for (People or Group) field through the JSON code.

In the following section:

...

 "children": [ 

                { 

                    "elmType": "div", 

                    "txtContent": "='Review Checklist for ' + [$Submittedby]"

This above is what I have now, and it doesn't pull the name from the form. I tried [$Submittedby.Email], [$Submittedby.DisplayName], [$Submittedby.sip] but they don't seem to pull any information.

Thanks in Advance
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,300 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Yanli Jiang - MSFT 24,356 Reputation points Microsoft Vendor
    2023-05-01T07:38:50.6033333+00:00

    Hi @Bahaa86 ,

    According to your description, the problem may be caused by not using the internal name of the column.

    You can use the following steps to find the internal name of this column:

    Click on Settings (gear) icon -->select List settings-->scroll down to the Columns section and click on the column name for which you want to find the internal name-->click on it-->go into column settings page like this:

    05012

    Where column name (CheckoutUser) after Field= of the url is the internal name.

    And then replace it in the JSON code to see if the problem is solved.

    For more information, please refer to:

    https://ganeshsanapblogs.wordpress.com/2023/04/17/how-to-find-the-internal-name-of-sharepoint-columns/

    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. Please make sure that you completely understand the risk before retrieving any suggestions from the above link.

    If the problem persists, please provide more details about the event so I can test it in my environment.

    Thank you for your support and understanding!

    Update on 5/3/2023

    I conducted a test and found that the column of Person and Group is indeed not displayed.

    I tried to change the elmType from div to span, no luck.

    As a workaround, it is recommended you change the column type of Submittedby from Person or Group to Single line of text. It can be worked fine.

    05027

    And I will still look into this issue.


    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.


  2. Yanli Jiang - MSFT 24,356 Reputation points Microsoft Vendor
    2023-05-09T08:52:46.35+00:00

    Hi @Bahaa86 ,

    After my research and testing, I found the way, it works for me. Add title after it to extract attributes, you can try it.

     ……
    "txtContent": "='Review Checklist for' + ' ' + [$Submittedby.title]"
    ……
    
    

    05092


    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.