<div dir="ltr">Terran, I think the get_tcn function is in scope... it just doesn't return a value. I followed the code in the developer console and it does grab the tcn.<div><br></div><div>The function sets the $scope.local_overlay_target_tcn to be equal to the found tcn value. But it doesn't return it.</div><div><br></div><div> function get_tcn(currTarget) {<br> egCore.pcrud.retrieve('bre', currTarget, {<br> select: {bre: ['tcn_value']}<br> }).then(function(rec) {<br> $scope.local_overlay_target_tcn = rec.tcn_value();<br> });<br> return;<br> };</div><div><br></div><div>Maybe the function should just return the value... and then instead of just calling it like</div><div><br></div><div> } else {<br> $scope.local_overlay_target = items[0]['bibid'];<br> var currTarget = items[0] ['bibid'];<br> get_tcn(currTarget);<br> }</div><div><br></div><div>You would use</div><div><br></div><div> } else {<br> $scope.local_overlay_target = items[0]['bibid'];<br> var currTarget = items[0] ['bibid'];<br> $scope.local_overlay_target_tcn = get_tcn(currTarget);<br> }</div><div><br></div><div>Josh</div><div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><table style="padding:0px;margin:10px 0;border:none"><tbody><tr><td style="vertical-align:middle;padding:0 7px 0 0"><img alt="Company logo" height="100" src="https://storage.googleapis.com/signaturesatori/customer-C039u5c5y/images/GJnfy.png" width="100"></td><td style="border-left:3px solid #e8e8e8;padding:7px 0 0 10px">
<div style="font-family:'arial','helvetica',sans-serif;font-size:14px;line-height:17px;font-weight:bold;color:rgb(238,142,22)"><span style="font-size:16px"><strong>Josh Stompro</strong></span></div>
<div style="font-family:'arial','helvetica',sans-serif;font-size:12px;line-height:14px;font-weight:normal;color:rgb(0,0,0);margin-bottom:10px"><span style="font-size:13px"><strong><em>IT Director</em><br>
<a href="mailto:stomproj@gsuite.larl.org" style="text-decoration:none;color:rgb(27,70,153)" target="_blank">stomproj@gsuite.larl.org</a></strong><br>
<strong>218-233-3757 ext. 139</strong> </span><span style="font-size:13px"><span style="color:rgb(1,186,239)">| </span><strong>Mobile: 218-790-2110</strong></span><br>
<br>
<span style="font-size:13px"><strong><span style="color:#1b4698">Lake Agassiz Regional Library | </span></strong></span><span style="font-size:13px"><strong><a href="http://www.larl.org" style="text-decoration:none;color:rgb(27,70,153)" target="_blank">www.larl.org</a></strong><br>
118 5th ST S<br>Moorhead MN 56560<br>
<span style="color:#01baef"><em><strong>Celebrating 60 Years of Service in 2021!</strong></em></span></span></div>
</td></tr></tbody></table>
</div></div></div></div>