{"id":4845,"date":"2026-12-03T10:11:12","date_gmt":"2026-12-03T10:11:12","guid":{"rendered":"https:\/\/himbap.com\/blog\/?p=4845"},"modified":"2026-12-03T10:11:12","modified_gmt":"2026-12-03T10:11:12","slug":"how-to-display-party-list-fields","status":"publish","type":"post","link":"https:\/\/himbap.com\/blog\/?p=4845","title":{"rendered":"How to Display Party List Fields"},"content":{"rendered":"\n<p><strong>Requirement<\/strong><\/p>\n\n\n\n<p>Do you want to display Party List fields, such as <strong>To<\/strong> and <strong>From<\/strong>, in Microsoft Power Pages? If yes, this article will help you achieve that using a quick code.<\/p>\n\n\n\n<p><strong>Details<\/strong><\/p>\n\n\n\n<p>Recently, while working on a customer&#8217;s environment, we received a request to display email details in a Power Pages subgrid. The <strong>To<\/strong> and <strong>From<\/strong> fields were not displaying correctly.<\/p>\n\n\n\n<p>The reason is that <strong>Party List attributes are currently not supported directly in Power Pages Entity Lists and Subgrids<\/strong>. When you try to display a Party List field, Power Pages may show <strong>[object Object]<\/strong> instead of the actual email address.<\/p>\n\n\n\n<p>Initially, I thought about creating two additional text fields for the To and From attributes. The idea was to copy the values from the original Party List fields into these text fields and then display them in the subgrid.<\/p>\n\n\n\n<p>However, before implementing this workaround, I decided to search for an existing solution. During my research, I came across below post:<\/p>\n\n\n\n<p><a rel=\"noreferrer noopener\" href=\"https:\/\/crmhub.blogspot.com\/2021\/02\/render-party-list-field-on-entity-listactivity-view-email-portal-comment-view-in-powerapp-portal-d365-crm-portal.html\" target=\"_blank\">How to Render Party List Fields on Entity Lists in Power Apps Portals<\/a><\/p>\n\n\n\n<p>The solution worked well, but we had one additional requirement in our environment.<\/p>\n\n\n\n<p>Our customer allowed users to send emails using <strong>unresolved email addresses<\/strong>. This means users could enter an email address that was not associated with any existing Contact, Account, or other Dataverse record.<\/p>\n\n\n\n<p>With the original solution, these unresolved email addresses were displayed as blank values.<\/p>\n\n\n\n<p>To handle this scenario, I made some modifications to the existing code so that both resolved and unresolved email addresses could be displayed correctly in Power Pages.<\/p>\n\n\n\n<p><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$(document).ready(function() {\n\n    $(\"#GRIDNameChange .entity-grid\").on(\"loaded\", listLoad);\n\n});\n\nfunction listLoad() {\n\n   \n    var gridRows = $(this).children(\".view-grid\").find(\"tr&#91;data-entity='email']\");\n\n    if (gridRows.length > 0) {\n\n        gridRows.each((i, row) => {\n\n\t        var fromCell = $(row).find(\"td&#91;data-attribute='from']\");\n\n            var toCell = $(row).find(\"td&#91;data-attribute='to']\");       \n\n            var fromEntityCollection = fromCell.data('value').Entities;\n\n            var toEntityCollection = toCell.data('value').Entities;\n\n            var fromNames = \"\";\n\n            var toNames = \"\";\n\n            fromEntityCollection.forEach(entity => {\n\n                var partyAttribute = entity.Attributes.find(x => x.Key == \"partyid\");\n\n                if (partyAttribute == null) return;\n\n                fromNames += partyAttribute.Value.Name + ',';\n\n            });\n\n            if (!fromNames.trim()) {\n\n                fromEntityCollection.forEach(entity => {\n\n                    var addressAttribute = entity.Attributes.find(\n                        x => x.Key == \"addressused\"\n                    );\n\n                    if (addressAttribute &amp;&amp; addressAttribute.Value) {\n                        fromNames += addressAttribute.Value + ',';\n                    }\n\n                });\n\n            }\n\n           \n            fromNames = fromNames.replace(\/,\\s*$\/, '');\n\n            toEntityCollection.forEach(entity => {\n\n                var partyAttribute = entity.Attributes.find(x => x.Key == \"partyid\");\n\n                if (partyAttribute == null) return;\n\n                toNames += partyAttribute.Value.Name + ',';\n\n            });\n if (!toNames.trim()) {\n\n                toEntityCollection.forEach(entity => {\n\n                    var addressAttribute = entity.Attributes.find(\n                        x => x.Key == \"addressused\"\n                    );\n\n                    if (addressAttribute &amp;&amp; addressAttribute.Value) {\n                        toNames += addressAttribute.Value + ',';\n                    }\n\n                });\n\n            }\n            toNames = toNames.replace(\/,\\s*$\/, '');\n\n            $(toCell).text(toNames);\n\n            $(fromCell).text(fromNames);\n\n        });\n\n    }\n\n}<\/code><\/pre>\n\n\n\n<p>We can use this code in the <strong>Custom Javascript<\/strong> section under <strong>Advanced <\/strong>tab in your web page. Make sure to change name of the grid according to your grid.<\/p>\n\n\n\n<p>Hope it will help someone!!<br><strong>Keep learning and Keep Sharing!!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Requirement Do you want to display Party List fields, such as To and From, in Microsoft Power Pages? If yes, this article will help you achieve that using a quick code. Details Recently, while working on a customer&#8217;s environment, we received a request to display email details in a Power Pages subgrid. The To and From fields were not displaying&#8230; <a href=\"https:\/\/himbap.com\/blog\/?p=4845\">Read more &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":4848,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[21,402,1103,728],"tags":[1192,1191,1189,1190],"_links":{"self":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4845"}],"collection":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4845"}],"version-history":[{"count":3,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4845\/revisions"}],"predecessor-version":[{"id":4849,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/posts\/4845\/revisions\/4849"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=\/wp\/v2\/media\/4848"}],"wp:attachment":[{"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4845"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4845"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/himbap.com\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4845"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}