<?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>A null parameter has been passed for month function</title><link>https://community.appian.com/discussions/f/rules/28911/a-null-parameter-has-been-passed-for-month-function</link><description>When I write a code &amp;quot;month(fv!item.asDate) = local!month&amp;quot;, why it&amp;#39;s showing a result A null parameter has been passed. How to resolve that part? 
 Also I put that part 
 
 if( a!isnullOrEmpty(index(fv!item, &amp;quot;asDate&amp;quot;, null)), false, contains( tointeger</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114032?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:59:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:664d9f7c-d19a-4352-83e7-f285ced304bc</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="78077" url="~/discussions/f/rules/28911/a-null-parameter-has-been-passed-for-month-function/114031#114031"]but she mentioned it is of type Date only[/quote]
&lt;p&gt;yeah, though from the evidence we&amp;#39;re seeing here, it&amp;#39;d be nice to confirm this, because it seems as if it might not be.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114031?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:55:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f276772f-7fed-4890-9058-263ad5b3e26a</guid><dc:creator>sanchitg0002</dc:creator><description>[quote userid="189470" url="~/discussions/f/rules/28911/a-null-parameter-has-been-passed-for-month-function/114027#114027"] &amp;quot;asDate&amp;quot; is Date types[/quote]
&lt;p&gt;&lt;br /&gt;Yes, but she mentioned it is of type Date only.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114030?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:51:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:18ed6e72-fffc-4f07-8ee7-0dd30b1ae591</guid><dc:creator>Mike Schmitt</dc:creator><description>[quote userid="78077" url="~/discussions/f/rules/28911/a-null-parameter-has-been-passed-for-month-function/114026#114026"]What is in ri!taskProductionList? [/quote]
&lt;p&gt;Namely, we need to verify that the &amp;quot;asDate&amp;quot; property of that rule input actually contains Date data.&amp;nbsp; The month() function (afaik) typecasts its input as date, so for example if OP is trying to call this function on String data, it&amp;#39;ll still return the same error message as seen here.&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1686333086299v1.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114029?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:50:45 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0270644-3a06-45af-bf60-4fb932967a8f</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;So &amp;quot;asDate&amp;quot; is a field which is in &amp;quot;&lt;span&gt;taskProductionList&amp;quot;.table.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114027?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:46:08 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:471f65f0-57e8-40ed-ad40-fea2fb16dc5e</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1686332648195v1.png" alt=" " /&gt;and the &amp;quot;asDate&amp;quot; is Date types. but it&amp;#39;s not working. plz suggest some another way.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114026?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:42:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:dad712c3-f12a-4fe9-91e2-366177323739</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;What is in ri!taskProductionList? screenshot?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114025?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:41:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39139822-f3ac-4f83-bce5-f39ad0cd2b06</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;Ikr, I was just showing how to do null handling and as far as compatibility concern, I assumed it was just a primitive type (date field), so will not disappoint but it seems like top level of null handling is also not applicable to this data. &lt;a href="/members/moulikad5353"&gt;moulikadas&lt;/a&gt; can you please share the data you are using in items?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114022?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:26:50 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:02c03104-1bb2-49e3-b048-9637d5e0c72b</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1686331527754v1.png" alt=" " /&gt;same error occurred yet&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114021?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:26:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:596bedbc-d15f-4a87-a2c4-43fbacfad28a</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;if(&lt;br /&gt; a!isnullOrEmpty(index(fv!item, &amp;quot;asDate&amp;quot;, null)),&lt;br /&gt; false,&lt;br /&gt; contains(&lt;br /&gt; tointeger(local!month),&lt;br /&gt; month(index(fv!item, &amp;quot;asDate&amp;quot;, null))&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;I already used that one, but it&amp;#39;s not resolved, bcz same error occurred. plz suggest another way&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114020?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:24:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:835ed60f-4c9f-4f3a-a32b-f2adfb1f4917</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;if(&lt;br /&gt; a!isnullOrEmpty(index(fv!item, &amp;quot;asDate&amp;quot;, null)),&lt;br /&gt; false,&lt;br /&gt; contains(&lt;br /&gt; tointeger(local!month),&lt;br /&gt; month(index(fv!item, &amp;quot;asDate&amp;quot;, null))&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;I already used that one, but same error occurred. Please suggest another code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114019?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 17:21:21 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9625fb2c-f200-4fe0-9698-d223e078733e</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Please don&amp;#39;t use isnull(). It was never a safe option. Instead, go for a!isnullorempty() should cover more usecases.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114010?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:50:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:d65e7e40-12fe-427c-b951-8dddfee69716</guid><dc:creator>laurensw</dc:creator><description>&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!forEach(
  local!items,
  if(
    a!isnullOrEmpty(index(fv!item, &amp;quot;asDate&amp;quot;, null)),
    false,
    contains(
      tointeger(local!month),
      month(index(fv!item, &amp;quot;asDate&amp;quot;, null))
    )
  )
)&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;For instance the above. I added some additional checks since I don&amp;#39;t know your data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114009?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:45:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a0ac6e47-a0b5-4f21-b0d3-c44cd5c5fac2</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;So how to write that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114008?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:42:57 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a318a795-6875-44b1-8aa8-abf1e7da1f31</guid><dc:creator>laurensw</dc:creator><description>&lt;p&gt;Always make sure to make expressions null-safe. i.e. don&amp;#39;t process any value that you know already is null.&lt;/p&gt;
&lt;p&gt;For the rest the error given is rather clear.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114007?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:42:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4a89fd22-1ce9-42ca-b42f-0fe5644bf17a</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/15/pastedimage1686321696751v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;This the error&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114006?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:40:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2adb689d-0f9e-43b7-b3c3-fb88a54aafcc</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;Are you sure that the error is due to month() only? Can you post screenshot of the error?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114005?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:35:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2f561ff3-73db-4d54-a534-e63a4d816e40</guid><dc:creator>moulikadas</dc:creator><description>&lt;p&gt;No, it&amp;#39;s not working. same error also showing&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: A null parameter has been passed for month function</title><link>https://community.appian.com/thread/114003?ContentTypeID=1</link><pubDate>Fri, 09 Jun 2023 14:28:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:12e8dab3-c4c0-40bb-84de-ec649bf98e04</guid><dc:creator>sanchitg0002</dc:creator><description>&lt;p&gt;You need to first check that the date you are passing in month() is not null, add an if condition to it.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;if(
  isnull(fv!item.asDate),
  false,
  month(fv!item.asDate) = local!month
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>