<?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>Convert Local Variable to Array</title><link>https://community.appian.com/discussions/f/data/18251/convert-local-variable-to-array</link><description>Hello, 
 I am using local variable as a filter for a query: 
 
 a!queryFilter( field: &amp;quot;codigoMunicipio&amp;quot;, operator: &amp;quot;IN&amp;quot;, value: local!municipioMultiple ) 
 Problem is tha the variable is passed as String and the filter have condition IN 
 Which generates</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71856?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 19:26:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:12accb29-1dba-421c-9b41-b5718b7ba2a2</guid><dc:creator>ankita0004</dc:creator><description>&lt;p&gt;Great&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71829?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 15:53:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9660e78e-364c-4a9a-addb-2af7a4c00ae3</guid><dc:creator>Vladimir Vasilev</dc:creator><description>&lt;p&gt;Ok at the end of the day this sollution worked !&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71823?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 14:21:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9d738612-fb7c-4a76-baa2-862cc5613929</guid><dc:creator>Vladimir Vasilev</dc:creator><description>&lt;p&gt;Hello Mike,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was getting the error when the interface load when I was using Rule Imputs saying that the rull input does not have value. This is why I have changed it to local variables. Now I get the error when I change the drop down filter example when I choose January for example this is when the error is happening. It&amp;#39;s like the choosen value can&amp;#39;t be passed to the &amp;quot;IN&amp;quot; query filter.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71816?ContentTypeID=1</link><pubDate>Mon, 03 Feb 2020 13:31:31 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3c6e6e4-2f92-4adb-83af-8f00a557b5e8</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Are you seeing the error immediately upon trying to load the interface?&amp;nbsp; If so, then my first guess is that since you&amp;#39;re initializing local!municipioMultiple with no value, this is resulting in it having a non-multiple &amp;quot;null&amp;quot; value, which the query wouldn&amp;#39;t like.&amp;nbsp; So the first and easiest thing I&amp;#39;d suggest you change is in your variable definition, set the initial value like:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;local!municipioMultiple: {},&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Also, you will probably need to do this conversion for local!searchMonth also, since that seems to be the one your error message is actually complaining about.&amp;nbsp; And any other local variables that are passed into the query with the assumption that they&amp;#39;re an array (though from a quick scan of your code, it appears those might be the only two).&lt;/p&gt;
&lt;p&gt;As a side note: a good practice in general is to create an Expression Rule to handle any Query Entity which might be used in more than one place in the system.&amp;nbsp; They can be set up to be flexible and easily handle multiple different use cases with multiple different assumed input sets, with little to no extra effort.&amp;nbsp; I bring this up mainly because if you had done this for yours already, you likely wouldn&amp;#39;t be having the error you&amp;#39;re getting, due to the fact that you would have had to type cast these two filter variables as &amp;quot;array&amp;quot; type in the Rule Inputs of the expression rule, and therefore they&amp;#39;d manually typecast even a blank non-array incoming string as an empty set, and not break the query when doing the initial page load with no filter data set.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71796?ContentTypeID=1</link><pubDate>Sun, 02 Feb 2020 15:48:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:93e531df-593c-4c58-8f96-89fe276cec04</guid><dc:creator>Vladimir Vasilev</dc:creator><description>&lt;p&gt;I have updated the whole code in the previous reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;attaching here the CDT&amp;nbsp;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/16/cdt.jpg" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71794?ContentTypeID=1</link><pubDate>Sun, 02 Feb 2020 02:04:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:522bfb94-9aa9-4741-894d-fe910b7fcf83</guid><dc:creator>ankita0004</dc:creator><description>&lt;p&gt;Hi, Can you send me the complete query entity code with related xsd code? &lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71793?ContentTypeID=1</link><pubDate>Sun, 02 Feb 2020 01:20:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a7587b4a-ec9b-4b21-8ba9-a6853941f991</guid><dc:creator>Vladimir Vasilev</dc:creator><description>&lt;p&gt;Hello Ankit,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you for your answer. I have tried it and receiving the same error.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71789?ContentTypeID=1</link><pubDate>Sat, 01 Feb 2020 18:35:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2626f8ab-4be9-483e-8c73-edea729ef229</guid><dc:creator>ankita0004</dc:creator><description>&lt;p&gt;&lt;span&gt;Looking like it is a type casting issue, try like this for once&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;a!queryFilter(&lt;/span&gt;&lt;br /&gt;&lt;span&gt;field: &amp;quot;codigoMunicipio&amp;quot;,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;operator: &amp;quot;IN&amp;quot;,&lt;/span&gt;&lt;br /&gt;&lt;span&gt;value: {&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;touniformstring(&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;local!municipioMultiple&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;)&lt;br /&gt;}&lt;br /&gt;&lt;span&gt;)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71787?ContentTypeID=1</link><pubDate>Sat, 01 Feb 2020 01:54:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bf560e95-90bb-4b99-80f0-340e06357667</guid><dc:creator>Vladimir Vasilev</dc:creator><description>&lt;p&gt;Here is the whole Expression&lt;/p&gt;
&lt;p&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!municipioMultiple,
  local!municipioMultipleNoGravable,
  local!searchMonth,
  local!searchMonthNoGravable,
  local!searchYear,
  local!searchYearNoGravable,
  local!municipio,
  local!municipioNoGravable,
  local!saveData,
  local!municipios: rule!TAX_ColoPOC_Municipio_Names(),
  local!importesNoGravables: rule!TAX_ColoPOC_GetAllImportesNoGravables(),
  a!formLayout(
    label: &amp;quot;&amp;quot;,
    contents: {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!imageField(
                label: &amp;quot;&amp;quot;,
                labelPosition: &amp;quot;ABOVE&amp;quot;,
                images: {
                  a!documentImage(
                    document: cons!CONS_HEADER_IMAGE
                  )
                },
                size: &amp;quot;FIT&amp;quot;,
                isThumbnail: false,
                style: &amp;quot;STANDARD&amp;quot;,
                align: &amp;quot;CENTER&amp;quot;
              )
            }
          )
        }
      ),
      rule!FPKB_SectionHeader(
        icon: &amp;quot;file-o&amp;quot;,
        highlightText: &amp;quot;Reporte&amp;quot;,
        secondaryText: &amp;quot;Provisiones&amp;quot;
      ),
      a!sectionLayout(
        label: &amp;quot;TITLE&amp;quot;,
        contents: {
          a!columnsLayout(
            columns: {
              a!columnLayout(
                contents: {
                  a!multipleDropdownField(
                    label: &amp;quot;Month&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    placeholder: &amp;quot;--- Seleccionar Mes ---&amp;quot;,
                    choiceLabels: {
                      &amp;quot;January&amp;quot;,
                      &amp;quot;February&amp;quot;,
                      &amp;quot;March&amp;quot;                  
                    },
                    choiceValues: {
                    &amp;quot;January&amp;quot;,
                      &amp;quot;February&amp;quot;,
                      &amp;quot;March&amp;quot;                    
                    },
                    value: local!searchMonth,
                    saveInto: local!searchMonth,
                    validations: {}
                  )
                }
              ),
              a!columnLayout(
                contents: {
                  a!textField(
                    label: &amp;quot;A&amp;#241;o&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    value: local!searchYear,
                    saveInto: local!searchYear,
                    refreshAfter: &amp;quot;UNFOCUS&amp;quot;,
                    validations: {}
                  )
                }
              ),
              a!columnLayout(
                contents: {
                  a!multipleDropdownField(
                    label: &amp;quot;Municipio&amp;quot;,
                    labelPosition: &amp;quot;ABOVE&amp;quot;,
                    placeholder: &amp;quot;--- Seleccionar Municipio ---&amp;quot;,
                    choiceLabels: index(
                      local!municipios,
                      &amp;quot;poblacion&amp;quot;
                    ),
                    choiceValues: index(
                      local!municipios,
                      &amp;quot;zip&amp;quot;
                    ),
                    value: local!municipioMultiple,
                    saveInto: local!municipioMultiple,
                    showwhen: true,
                    validations: {}
                  )
                }
              )
            }
          ),
          a!gridField(
            label: &amp;quot;&amp;quot;,
            labelPosition: &amp;quot;ABOVE&amp;quot;,
            data: a!queryEntity(
              entity: cons!CONS_ENTITY_POINTER_INGRESOS_GRAVABLES,
              query: a!query(
                aggregation: a!queryAggregation(
                  aggregationColumns: {
                    a!queryAggregationColumn(
                      field: &amp;quot;codigoMunicipio&amp;quot;,
                      isGrouping: true
                    ),
                    a!queryAggregationColumn(
                      field: &amp;quot;descripcionMunicipio&amp;quot;,
                      isGrouping: true
                    ),
                    a!queryAggregationColumn(
                      field: &amp;quot;importeDocumento&amp;quot;,
                      alias: &amp;quot;importeDocumento_sum&amp;quot;,
                      aggregationFunction: &amp;quot;SUM&amp;quot;
                    ),
                    a!queryAggregationColumn(
                      field: &amp;quot;tarifaICA&amp;quot;,
                      alias: &amp;quot;tarifaICA_sum&amp;quot;,
                      aggregationFunction: &amp;quot;SUM&amp;quot;
                    ),
                    a!queryAggregationColumn(
                      field: &amp;quot;tarifaBomberil&amp;quot;,
                      alias: &amp;quot;tarifaBomberil_sum&amp;quot;,
                      aggregationFunction: &amp;quot;SUM&amp;quot;
                    ),
                    a!queryAggregationColumn(
                      field: &amp;quot;tarifaAvisosYTableros&amp;quot;,
                      alias: &amp;quot;tarifaAvisosYTableros_sum&amp;quot;,
                      aggregationFunction: &amp;quot;SUM&amp;quot;
                    )
                  }
                ),
                logicalExpression: a!queryLogicalExpression(
                  operator: &amp;quot;AND&amp;quot;,
                  filters: {
                    a!queryFilter(
                      field: &amp;quot;importMonth&amp;quot;,
                      operator: &amp;quot;IN&amp;quot;,
                      value: touniformstring (local!searchMonth)
                    ),
                    a!queryFilter(
                      field: &amp;quot;importYear&amp;quot;,
                      operator: &amp;quot;=&amp;quot;,
                      value: local!searchYear
                    ),
                    a!queryFilter(
                      field: &amp;quot;codigoMunicipio&amp;quot;,
                      operator: &amp;quot;IN&amp;quot;,
                      value: local!municipioMultiple
                    )
                  },
                  ignoreFiltersWithEmptyValues: true
                ),
                pagingInfo: fv!pagingInfo
              ),
              fetchTotalCount: true
            ),
            columns: {
              a!gridColumn(
                label: &amp;quot;Codigo Municipio&amp;quot;,
                sortField: &amp;quot;codigoMunicipio&amp;quot;,
                value: fv!row.codigoMunicipio
              ),
              a!gridColumn(
                label: &amp;quot;Municipio&amp;quot;,
                sortField: &amp;quot;descripcionMunicipio&amp;quot;,
                value: fv!row.descripcionMunicipio
              ),
              a!gridColumn(
                label: &amp;quot;Importe Gravable&amp;quot;,
                sortField: &amp;quot;importeDocumento_sum&amp;quot;,
                value: dollar(
                  fv!row.importeDocumento_sum
                )
              ),
              a!gridColumn(
                label: &amp;quot;Importe ICA&amp;quot;,
                sortField: &amp;quot;tarifaICA_sum&amp;quot;,
                value: dollar(
                  fv!row.tarifaICA_sum
                )
              ),
              a!gridColumn(
                label: &amp;quot;Importe Bomberil&amp;quot;,
                sortField: &amp;quot;tarifaBomberil_sum&amp;quot;,
                value: dollar(
                  fv!row.tarifaBomberil_sum
                )
              ),
              a!gridColumn(
                label: &amp;quot;Importe Avisos Y Tableros&amp;quot;,
                sortField: &amp;quot;tarifaAvisosYTableros_sum&amp;quot;,
                value: dollar(
                  fv!row.tarifaAvisosYTableros_sum
                )
              )
            },
            validations: {}
          )
        }
      )        
    }
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71786?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 22:06:37 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:93ec0bac-240a-40ef-9de8-d4d0349b462c</guid><dc:creator>Siddharth</dc:creator><description>&lt;p&gt;Can you please paste the contents of your expression so that it would be easier to debug the error.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71785?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 21:09:18 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:977f9c8c-5323-4ce3-8455-71e033fd2829</guid><dc:creator>Vladimir Vasilev</dc:creator><description>&lt;p&gt;Hello Siddharth,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I have applied this change but there is no difference. Still showing the same error.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Convert Local Variable to Array</title><link>https://community.appian.com/thread/71784?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 21:04:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9fb173e-c830-41aa-8dc3-ddb66f236701</guid><dc:creator>Siddharth</dc:creator><description>&lt;p&gt;Hi Vladmir - Pass your value argument in {} braces. That should hopefully solve your issue.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!queryFilter(
field: &amp;quot;codigoMunicipio&amp;quot;,
operator: &amp;quot;IN&amp;quot;,
value: {local!municipioMultiple}
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>