0

I tried to provision a modern site with a people web part.

The configuration of this web part is mainly stored in a property called JsonControlData. I would like to know how to properly add parameters to this in the template.

The example below is wrong, because the {parameter:name} and other parameters are displayed as text in the site when I apply the template:

<pnp:CanvasControl WebPartType="People" JsonControlData="{&quot;id&quot;: &quot;7f718435-ee4d-431c-bdbf-9c4ff326f46e&quot;, &quot;instanceId&quot;: &quot;2c0ce1ac-0a27-42be-a612-1ddd93cb4f39&quot;, &quot;title&quot;: &quot;People&quot;, &quot;description&quot;: &quot;Display selected people and their profiles&quot;, &quot;dataVersion&quot;: &quot;1.3&quot;, &quot;properties&quot;: {&quot;layout&quot;:1,&quot;persons&quot;:[{&quot;id&quot;:&quot;
{parameter:email}&quot;,&quot;upn&quot;:&quot;&quot;,&quot;role&quot;:&quot;
{parameter:role}&quot;,&quot;department&quot;:&quot;
{parameter:department}&quot;,&quot;phone&quot;:&quot;&quot;,&quot;sip&quot;:&quot;&quot;}]}, &quot;serverProcessedContent&quot;: {&quot;htmlStrings&quot;:{},&quot;searchablePlainTexts&quot;:{&quot;title&quot;:&quot;&quot;,&quot;persons[0].name&quot;:&quot;{parameter:name}&quot;,&quot;persons[0].email&quot;:&quot;{parameter:email}&quot;},&quot;imageSources&quot;:{},&quot;links&quot;:{}}, &quot;dynamicDataPaths&quot;: {}, &quot;dynamicDataValues&quot;: {}}" ControlId="7f718435-ee4d-431c-bdbf-9c4ff326f46e" Order="1" Column="3" />

Update: I managed to set some of the properties like:

        <pnp:CanvasControl WebPartType="People" ControlId="7f718435-ee4d-431c-bdbf-9c4ff326f46e" Order="1" Column="3">
          <pnp:CanvasControlProperties>
            <pnp:CanvasControlProperty Key="id" Value="7f718435-ee4d-431c-bdbf-9c4ff326f46e" />
            <pnp:CanvasControlProperty Key="instanceId" Value="2c0ce1ac-0a27-42be-a612-1ddd93cb4f39" />
            <pnp:CanvasControlProperty Key="title" Value="People" />
            <pnp:CanvasControlProperty Key="dataVersion" Value="1.3" />
        </pnp:CanvasControlProperties>
      </pnp:CanvasControl>

But I cannot set the nested properties under the properties key.

The following didn't work:

<pnp:CanvasControlProperty Key="properties.persons[0].id" Value="myemail@mydomain.com" />

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.