<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.appian.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Simple Questions from a n00b</title><link>https://community.appian.com/discussions/f/rules/10263/simple-questions-from-a-n00b</link><description>I&amp;#39;m having an issue with two of my interfaces. 
 
 1. For the interface that manages the employees in an editable grid, I want to have a dropdown box that selects who that person reports to. In the CDT for employees, I have a field called &amp;quot;isSupervisor</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45352?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 18:04:09 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:896d46af-6b87-4038-9e0c-38e3b3b6c7e1</guid><dc:creator>Josh</dc:creator><description>No problem!&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45350?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 17:04:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:90e8f69c-bd0c-49db-b21b-8f1226920eb1</guid><dc:creator>Doctor Kurt Durt</dc:creator><description>Phenominal. That works perfect. Thanks, Josh.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45347?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 15:07:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39f7ff9f-2f3d-407d-8af6-29546708f01b</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;Try something like this, replacing &amp;quot;yourIdFieldHere&amp;quot; with the pk of your table.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!supervisorId,
  with(
    local!employeeDS: a!queryEntity(
      cons!FSRC_EMPLOYEES_ENTITY,
      a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: &amp;quot;firstName&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;lastName&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;yourIdFieldHere&amp;quot;
            )
          }
        ),
        filter: a!queryFilter(
          field: &amp;quot;isSupervisor&amp;quot;,
          operator: &amp;quot;=&amp;quot;,
          value: true
        ),
        pagingInfo: topaginginfo(
          1,
          - 1
        )
      )
    ),
    a!dropdownField(
      label: &amp;quot;test&amp;quot;,
      placeholderLabel: &amp;quot;--- test ---&amp;quot;,
      choiceLabels: apply(
        concat(_, &amp;quot; &amp;quot;, _), 
        merge(
            index(local!employeeDS.data, &amp;quot;firstName&amp;quot;, {}),
            index(local!employeeDS.data, &amp;quot;lastName&amp;quot;, {})
        )
      ),
      choiceValues: index(local!employeeDS.data, &amp;quot;yourIdFieldHere&amp;quot;, {}),
      value: local!supervisorId,
      saveInto: local!supervisorId
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45345?ContentTypeID=1</link><pubDate>Tue, 09 May 2017 14:48:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:326aef24-b1f3-4cfd-bcb0-6403997b068a</guid><dc:creator>Doctor Kurt Durt</dc:creator><description>&lt;p&gt;It was giving me the same error about isSupervisor passing a null variable, but after tinkering with it for a day, I&amp;#39;ve gotten a little bit closer:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  with(
    local!employeeDS: a!queryEntity(
      cons!FSRC_EMPLOYEES_ENTITY,
      a!query(
        selection: a!querySelection(
          columns: {
            a!queryColumn(
              field: &amp;quot;firstName&amp;quot;
            ),
            a!queryColumn(
              field: &amp;quot;lastName&amp;quot;
            )
          }
        ),
        filter: a!queryFilter(
          field: &amp;quot;isSupervisor&amp;quot;,
          operator: &amp;quot;=&amp;quot;,
          value: true
        ),
        pagingInfo: topaginginfo(
          1,
          - 1
        )
      )
    ),
    a!dropdownField(
      label: &amp;quot;test&amp;quot;,
      placeholderLabel: &amp;quot;--- test ---&amp;quot;,
      choiceLabels: local!employeeDS.data,
      choiceValues: local!employeeDS.data,
      saveInto: {}
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The output I get in the dropdown is [firstName:Bill,lastName:Smith]&lt;/p&gt;
&lt;p&gt;Almost there, but formatting seems to be the issue now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45322?ContentTypeID=1</link><pubDate>Mon, 08 May 2017 12:34:17 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a25fdd16-9512-4721-862f-261f2a379459</guid><dc:creator>Josh</dc:creator><description>What exactly is the error message you have with #1?&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45306?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 23:35:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:5ba05123-f584-4a7d-bf24-758c0376f6b3</guid><dc:creator>Doctor Kurt Durt</dc:creator><description>I was able to get #2 to work. I found no joy in #1. This one is still kicking me in the face.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45298?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 15:37:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e2d77ce7-b6e0-4d4a-9f50-e1df142855e6</guid><dc:creator>Josh</dc:creator><description>&lt;p&gt;Hi Fred,&lt;br /&gt; &lt;br /&gt; You need to specify the &amp;quot;value&amp;quot; attribute for the dropdownField. It would probably look like &amp;quot;value: local!newEmployee.supervisor&amp;quot; or &amp;quot;value: index(local!newEmployee, &amp;quot;supervisor&amp;quot;, null)&amp;quot; if you want to be a little bit more safe. Using dot notation (local!newEmployee.supervisor) will break if the supervisor field can&amp;#39;t be found. index(local!newEmployee, &amp;quot;supervisor&amp;quot;, null) will return null (the third parameter) if the supervisor field can&amp;#39;t be found. Note:&amp;nbsp;The dot notation must be used in the saveInto attribute.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45297?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 15:21:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0203048-022d-4afb-974a-16d832813ca8</guid><dc:creator>Doctor Kurt Durt</dc:creator><description>&lt;p&gt;Thank you for your reply, Josh. I do configure a placeholderLabel for the dropdown box and there is data in the entity.&lt;/p&gt;
&lt;p&gt;1. Here is the complete code for the dropdown field:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!dropdownField(
                label: &amp;quot;Supervisor&amp;quot;,
                labelPosition: &amp;quot;ADJACENT&amp;quot;,
                placeHolderLabel: &amp;quot;--- Select One ---&amp;quot;,
                choiceLabels: index(local!newEmployee.firstName, where(local!newEmployee.isSupervisor)),
                choiceValues: index(local!newEmployee.firstName, where(local!newEmployee.isSupervisor)),
                saveInto: {
                  local!newEmployee.supervisor
                },
                refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
                validations: {}
                )
                
                &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;I believe this configuration gives and error saying that the value is null. I can&amp;#39;t verify at the moment because I have an unrelated DB issue I have to fix later today.&lt;/p&gt;
&lt;p&gt;This interface is also configured with a!writeToDataStoreEntity(), so when I don&amp;#39;t get an error, for example, if I just configure this field as a textField, then it saves and updates the data store successfully.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2. I will try those suggestions when I can. Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Simple Questions from a n00b</title><link>https://community.appian.com/thread/45294?ContentTypeID=1</link><pubDate>Fri, 05 May 2017 14:31:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:24933c2e-3bed-4c6f-9d85-a20bd2c35f50</guid><dc:creator>Josh</dc:creator><description>1. If your value is null in a dropdown component, the component will throw an error unless you specify the placeholderLabel attribute. This might help in your debugging. It would be helpful if you posted a more verbose snippet so we could see what exactly the problem is.&lt;br /&gt;
&lt;br /&gt;
2. saveInto is only triggered when the user interacts with the field. Because your fields are read only, the saveInto will never be triggered, which is why you see the proper value, but you do not see the value saved to the rule input field. One common way around this is to either load the values in the input of your user input task, or save them on button press (ex. a!buttonWidgetSubmit(saveInto: {a!save(ri!vehicles.vehicle, concat({local!year},&amp;quot; &amp;quot;,{local!make},&amp;quot; &amp;quot;,{local!model}))}))&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>