<?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>how to extract year from date and time with timezone</title><link>https://community.appian.com/discussions/f/data/30875/how-to-extract-year-from-date-and-time-with-timezone</link><description>I have record which has &amp;quot; created on &amp;quot;field. I wanted to filter all records that is created for this year. But when I try to convert the created on field to year for comparison. It shows error. 
 
 Expression evaluation error at function a!queryRecordType</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: how to extract year from date and time with timezone</title><link>https://community.appian.com/thread/123048?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 13:39:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:cf99740f-807c-4b86-a96e-c7ec89e37264</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;&lt;strong&gt;I don&amp;#39;t understand the audacity of these people creating accounts and making such post on a platform which is completely dedicated to Technical knowledge sharing. I think there should be more aggressive measures on such accounts.&lt;/strong&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract year from date and time with timezone</title><link>https://community.appian.com/thread/123044?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 12:53:30 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:1bd69b00-93ee-4563-b9e0-58d028dd15bd</guid><dc:creator>shwetam8988</dc:creator><description>[deleted]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract year from date and time with timezone</title><link>https://community.appian.com/thread/123041?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 12:21:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:bcb2214c-9c7a-436f-acba-7eaff108bbec</guid><dc:creator>Konduru Chaitanya</dc:creator><description>&lt;p&gt;Hello&amp;nbsp;&lt;a class="internal-link view-user-profile" href="/members/kowsalyav7826"&gt;kowsalyavijayan&lt;/a&gt;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Create a custom record field shown as below&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1702297099283v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;Select the field where your Date and Time value exists&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1702297129971v2.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Then Create a user filter from the Filters in a expression mode&lt;br /&gt;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1702297180323v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s a code snippet if needed for reference, replace the field here with your custom record field value and test it out.&lt;br /&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!year:a!queryRecordType(
    recordType: &amp;#39;recordType!{55d40bd2-3986-4477-bd9f-627d5a979404}STE Asset Request&amp;#39;,
    fields: a!aggregationFields(
      groupings: {
        a!grouping(
          field: &amp;#39;recordType!{55d40bd2-3986-4477-bd9f-627d5a979404}STE Asset Request.fields.{0c614836-7916-4250-acf6-a19403f6dd18}raisedonYear&amp;#39;,
          alias: &amp;quot;year&amp;quot;
        )
      }
    ),
    pagingInfo: a!pagingInfo(startIndex: 1,batchSize: 5000)
  ).data,
  a!recordFilterList(
    name: &amp;quot;Year&amp;quot;,
    options: a!forEach(
      items: index(local!year,&amp;quot;year&amp;quot;,&amp;quot;&amp;quot;),
      expression: a!recordFilterListOption(
        id: fv!index,
        name: fv!item,
        filter: a!queryFilter(
          field: &amp;#39;recordType!{55d40bd2-3986-4477-bd9f-627d5a979404}STE Asset Request.fields.{0c614836-7916-4250-acf6-a19403f6dd18}raisedonYear&amp;#39;,
          operator: &amp;quot;=&amp;quot;,
          value: fv!item
        )
      )
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Below is the outcome of the above&amp;nbsp;&lt;br /&gt;&lt;img style="max-height:240px;max-width:320px;" src="/resized-image/__size/640x480/__key/communityserver-discussions-components-files/16/pastedimage1702297270208v4.png" alt=" " /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract year from date and time with timezone</title><link>https://community.appian.com/thread/122989?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2023 05:33:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:7ff530ac-65be-4efd-907f-c80607207042</guid><dc:creator>Niranjan79</dc:creator><description>&lt;p&gt;Hi &lt;a href="/members/kowsalyav7826"&gt;kowsalyavijayan&lt;/a&gt;&amp;nbsp;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;You can create a custom record field&amp;nbsp; &amp;#39;year&amp;#39; using extract partial dates template and refer this new custom field to filter the data that is created for this year.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to extract year from date and time with timezone</title><link>https://community.appian.com/thread/122981?ContentTypeID=1</link><pubDate>Sun, 10 Dec 2023 18:42:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a9d65f4b-95e7-4436-8e26-d0b78978a630</guid><dc:creator>Stefan Helzle</dc:creator><description>&lt;p&gt;Can you share a few more details? Code snippets?&lt;/p&gt;
&lt;p&gt;Did you consider to use a custom record field that just holds the year part of that date?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>