title: Lightswitch HTML Client - set modal picker value when screen created
body: <p>ive done quite a bit of research into this now and non of the examples are helpful or apply. What I am trying to do is when the user loads the Add screen, I want the Details Picker to display a name when the screen is created rather than having to select it everytime. im sure this can be done but my javascript skills are lacking.</p>
  
  <p>thanks for any help, 
  and below is an example: </p>
  
  <p><img src="https://i.stack.imgur.com/8JMUm.png" alt="enter image description here"></p>
  
  <p>this name is stored within a table and can be searched for in this modal picker/details picker  but as you can imagine, if this value is required 50% of the time then manually adding it is not only time consuming but would become a little tedious</p>
  
  <p>a text box can be manipulated by using <code>contentItem.value</code> or <code>element.innerText</code> after pressing <code>post render</code> on each item, but this does not work with this type of control, and I am presented with the below error:
  <img src="https://i.stack.imgur.com/MEv4W.png" alt="enter image description here"></p>
  
  <p>heres some useful information which may help:</p>
  
  <ul>
  <li><strong>ProjectData</strong> (datasource)</li>
  <li>Main screen references <strong>OrderRequest</strong></li>
  <li>foreign key link references <strong>ShippingContact</strong> and CustomerName is searched for on the DetailsPicker</li>
  </ul>
  
  <p>based on the below answer do I need to substitute in anything to the top function, and then base don the 2nd part of code, where you have written <code>defaultLookup(screen.Customer, "Contact", "Contacts",</code> what needs to go here?</p>
  
  <p>example of what im trying to change, and unfortunately this isn't working</p>
  
  <pre><code>var defaultValue = "Test User";
      var filter = "(ContactName eq " + msls._toODataString(defaultValue, ":String") + ")";
      defaultLookup(screen.OrderRequest, "ContactName", "ShippingContacts", { filter: filter });
  </code></pre>