<?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>Custom Picker Field Null and Not Saving</title><link>https://community.appian.com/discussions/f/user-interface/22960/custom-picker-field-null-and-not-saving</link><description>Hello, I posted a couple of minutes ago about a dropdown field doing something similar to this except now it is a custom picker field. I put the code below although you cant test because it has a rule in it. If you want you its just countries so you can</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Custom Picker Field Null and Not Saving</title><link>https://community.appian.com/thread/89029?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 19:06:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:536469ca-22d6-40bb-81c7-881d915f0309</guid><dc:creator>Kyle G</dc:creator><description>&lt;p&gt;I am silly, I forgot to hit test and was using old local variable data it worked perfectly thank you!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Picker Field Null and Not Saving</title><link>https://community.appian.com/thread/89028?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 18:54:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:89472b8a-1003-4023-85e6-3b9526772f08</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;Did you update the way you had initialized the locals before i.e. use empty string instead of null and then remove the use of cast from your save. Also did you use the suggest function from the recipe that was shared earlier. This should give the expected result as below -&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/13/Custom-Picker.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Picker Field Null and Not Saving</title><link>https://community.appian.com/thread/89027?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 18:27:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d427e2db-9969-46a8-8a2c-34b1c6aaf13c</guid><dc:creator>Kyle G</dc:creator><description>&lt;p&gt;The above solution did not work for me. It still has the same issue of clicking on something and then not saving that to the local variable.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Custom Picker Field Null and Not Saving</title><link>https://community.appian.com/thread/89026?ContentTypeID=1</link><pubDate>Mon, 13 Dec 2021 17:44:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c6551822-a079-46cf-91de-047b5067cfa6</guid><dc:creator>hrishikeshd997</dc:creator><description>&lt;p&gt;Below code should work (for adding up to 4 values). For the suggestFunction use the one from&amp;nbsp; &amp;quot;&lt;span&gt;Configure an Array Picker&lt;/span&gt;&amp;quot; SAIL recipe&lt;/p&gt;
&lt;p&gt;&lt;a href="https://docs.appian.com/suite/help/21.4/recipe-configure-an-array-picker.html"&gt;https://docs.appian.com/suite/help/21.4/recipe-configure-an-array-picker.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!pubProdCtry: cast(typeof({&amp;quot;&amp;quot;}), repeat(4, null())),
  local!dataProdCtry1: cast(typeof({&amp;quot;&amp;quot;}), repeat(4, null())),
  local!count: 1,
  local!datacount: 1,
  local!primary1: repeat(4, null),
  local!primary2: repeat(4, null),
  local!allCountryLabels: {&amp;quot;USA&amp;quot;, &amp;quot;UK&amp;quot;, &amp;quot;India&amp;quot;},
  local!allCountryAbbreviations: {&amp;quot;USA&amp;quot;, &amp;quot;UK&amp;quot;, &amp;quot;India&amp;quot;},
  {
    a!cardLayout(
      contents: {
        a!forEach(
          items: enumerate(local!count),
          expression: 
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!pickerFieldCustom(
                    label: &amp;quot;Producing Country&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    placeholder: &amp;quot;--- Search by Name or GENC 3 ---&amp;quot;,
                    maxSelections: 1,
                    suggestFunction: rule!TH_arrayPicker(
                      filter:_ , 
                      labels: local!allCountryLabels, 
                      identifiers: local!allCountryAbbreviations
                    ),
                    selectedLabels: a!forEach(
                      items: local!pubProdCtry[fv!index],
                      expression: index(local!allCountryLabels, wherecontains(fv!item, local!allCountryAbbreviations))
                    ),
                    value: local!pubProdCtry[fv!index],
                    saveInto: local!pubProdCtry[fv!index]
                  ),
                },
              ),
              a!columnLayout(
                contents: {
                  a!checkboxField(
                    label: &amp;quot;Primary&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    choiceLabels: {&amp;quot;&amp;quot;},
                    choiceValues: {true},
                    value: toboolean(local!primary1[fv!index]),
                    saveInto: {local!primary1[fv!index]},
                    choiceLayout: &amp;quot;COMPACT&amp;quot;,
                    choiceStyle: &amp;quot;STANDARD&amp;quot;,
                    validations: {},
                    align: &amp;quot;CENTER&amp;quot;
                  )
                },
                width: &amp;quot;EXTRA_NARROW&amp;quot; 
              )
            }
          )
        ),
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!buttonArrayLayout(
                  buttons: {
                    a!buttonWidget(
                      label: &amp;quot;Remove&amp;quot;,
                      icon: &amp;quot;minus&amp;quot;,
                      value: local!count - 1,
                      saveInto: local!count,
                      size: &amp;quot;SMALL&amp;quot;,
                      style: &amp;quot;LINK&amp;quot;
                    )
                  },
                  align: &amp;quot;END&amp;quot;
                )
              },
              width: &amp;quot;AUTO&amp;quot;
            ),
            a!columnLayout(
              contents: {
                a!buttonArrayLayout(
                  buttons: {
                    a!buttonWidget(
                      label: &amp;quot;Add&amp;quot;,
                      icon: &amp;quot;plus&amp;quot;,
                      value: local!count + 1,
                      saveInto: local!count,
                      size: &amp;quot;SMALL&amp;quot;,
                      width: &amp;quot;MINIMIZE&amp;quot;,
                      style: &amp;quot;LINK&amp;quot;
                    )
                  },
                  align: &amp;quot;END&amp;quot;,
                  marginBelow: &amp;quot;STANDARD&amp;quot;
                )
              },
              width: &amp;quot;EXTRA_NARROW&amp;quot;
            )
          }
        ),
      },
      height: &amp;quot;AUTO&amp;quot;,
      style: &amp;quot;NONE&amp;quot;,
      marginBelow: &amp;quot;STANDARD&amp;quot;
    ),

    a!cardLayout(
      contents: {
        a!forEach(
          items: enumerate(local!datacount),
          expression: 
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!pickerFieldCustom(
                    label: &amp;quot;Data Producing Country&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    placeholder: &amp;quot;--- Search by Name or GENC 3 ---&amp;quot;,
                    maxSelections: 1,
                    suggestFunction: rule!TH_arrayPicker(
                      filter:_ , 
                      labels: local!allCountryLabels, 
                      identifiers: local!allCountryAbbreviations
                    ),
                    selectedLabels: a!forEach(
                      items: local!dataProdCtry1[fv!index],
                      expression: index(local!allCountryLabels, wherecontains(fv!item, local!allCountryAbbreviations))
                    ),
                    value: local!dataProdCtry1[fv!index],
                    saveInto: local!dataProdCtry1[fv!index],
                    required: true
                  )
                }
              ),
              a!columnLayout(
                contents: {
                  a!checkboxField(
                    label: &amp;quot;Primary&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    choiceLabels: {&amp;quot;&amp;quot;},
                    choiceValues: {true},
                    value: toboolean(local!primary2[fv!index]),
                    saveInto: {local!primary2[fv!index]},
                    choiceLayout: &amp;quot;COMPACT&amp;quot;,
                    choiceStyle: &amp;quot;STANDARD&amp;quot;,
                    validations: {},
                    align: &amp;quot;CENTER&amp;quot;
                  )
                },
                width: &amp;quot;EXTRA_NARROW&amp;quot; 
              )
            }
          )
        ),
        a!columnsLayout(
          columns: {
            a!columnLayout(
              contents: {
                a!buttonArrayLayout(
                  buttons: {
                    a!buttonWidget(
                      label: &amp;quot;Remove&amp;quot;,
                      icon: &amp;quot;minus&amp;quot;,
                      value: local!datacount - 1,
                      saveInto: local!datacount,
                      size: &amp;quot;SMALL&amp;quot;,
                      style: &amp;quot;LINK&amp;quot;
                    )
                  },
                  align: &amp;quot;END&amp;quot;
                )
              },
              width: &amp;quot;AUTO&amp;quot;
            ),
            a!columnLayout(
              contents: {
                a!buttonArrayLayout(
                  buttons: {
                    a!buttonWidget(
                      label: &amp;quot;Add&amp;quot;,
                      icon: &amp;quot;plus&amp;quot;,
                      value: local!datacount + 1,
                      saveInto: local!datacount,
                      size: &amp;quot;SMALL&amp;quot;,
                      width: &amp;quot;MINIMIZE&amp;quot;,
                      style: &amp;quot;LINK&amp;quot;
                    )
                  },
                  align: &amp;quot;END&amp;quot;,
                  marginBelow: &amp;quot;STANDARD&amp;quot;
                )
              },
              width: &amp;quot;EXTRA_NARROW&amp;quot;
            )
          }
        )
      },
      height: &amp;quot;AUTO&amp;quot;,
      style: &amp;quot;NONE&amp;quot;,
      marginBelow: &amp;quot;STANDARD&amp;quot;
    ),
  }
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>