I have a related table that is published to my portal with a many to one relationship with my feature class.
I'm trying to pull the related records from the table into the feature class' popup using the following script(adapted from here):
var tbl <SPAN class="operator token">=</SPAN> <SPAN class="token function">FeatureSetByName</SPAN><SPAN class="punctuation token">(</SPAN>$datastore<SPAN class="punctuation token">,</SPAN><SPAN class="string token">"ConsumerAccess"</SPAN><SPAN class="punctuation token">)</SPAN>
var ftr <SPAN class="operator token">=</SPAN> $feature<SPAN class="punctuation token">[</SPAN><SPAN class="string token">"Business.BusinessID"</SPAN><SPAN class="punctuation token">]</SPAN>
var sql <SPAN class="operator token">=</SPAN> <SPAN class="string token">"BusinessID = '"</SPAN> <SPAN class="operator token">+</SPAN> ftr <SPAN class="operator token">+</SPAN> <SPAN class="string token">"'"</SPAN><SPAN class="punctuation token">;</SPAN>
var txt <SPAN class="operator token">=</SPAN> <SPAN class="token function">Filter</SPAN><SPAN class="punctuation token">(</SPAN>tbl<SPAN class="punctuation token">,</SPAN>sql<SPAN class="punctuation token">)</SPAN>
var outtxt <SPAN class="operator token">=</SPAN> <SPAN class="string token">""</SPAN>
<SPAN class="keyword token">for</SPAN> <SPAN class="punctuation token">(</SPAN>var accesstype in txt<SPAN class="punctuation token">)</SPAN><SPAN class="punctuation token">{</SPAN>
var txts <SPAN class="operator token">=</SPAN> ConsumerAccess<SPAN class="punctuation token">.</SPAN>AccessType
outtxt <SPAN class="operator token">+=</SPAN> txts<SPAN class="operator token">+</SPAN>TextFormatting<SPAN class="punctuation token">.</SPAN>NewLine
<SPAN class="punctuation token">}</SPAN>
<SPAN class="keyword token">return</SPAN> outtxt<SPAN class="line-numbers-rows"><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN><SPAN></SPAN></SPAN>I have tried using the DomainCode and DomainName functions within the declaring of the variable txts but I cant seem to get the description from the value. For example:

Thank you in advance if you have any suggestions