<?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>Rule to CDT</title><link>https://community.appian.com/discussions/f/new-to-appian/25540/rule-to-cdt</link><description>Hi All, 
 I am using read excel function to read the excel file and mapping these values to CDT. 
 I am giving timestamp field in excel and trying to map with CDT having data type &amp;#39;Date and Time&amp;#39;, and in postgres Db it has timestamp field, but it is not</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/100996?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 13:41:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:95310e59-21d6-4f3d-b277-4170b3cd8647</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;Nice to hear, thanks for confirming!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/100982?ContentTypeID=1</link><pubDate>Mon, 12 Sep 2022 10:17:42 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2c5c5969-d992-496b-a59a-0543c02bfbf6</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Thanks for your help, The issue is fixed with the help of your code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99912?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 14:04:23 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:8bb33eb0-a423-4043-87ac-e43254589c4c</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;You&amp;#39;re trying to do far too much at once, to be honest.&amp;nbsp; You should start with a small enough example to get working perfectly, then move up in complexity one step at a time only after getting the previous step working perfectly.&amp;nbsp; Several different things are going on here and it&amp;#39;s hard to enumerate them all.&lt;/p&gt;
&lt;p&gt;The one thing I&amp;#39;ll point out now is, your PV is of your CDT type, as far as I can see, like from your previous example. Note the data type of the timestamp fields:&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661176400950v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Now, on the other hand, your Expression Rule is getting the Excel data and then, presumably saving the result it&amp;#39;s getting straight into your PV.&amp;nbsp; For some reason you&amp;#39;ve disregarded my &lt;a href="/discussions/f/new-to-appian/25540/rule-to-cdt/99731#99731"&gt;prior guidance&lt;/a&gt; that you will need to individually replace your timestamp values with an actual Appian dateTime value prior to doing this casting, so instead what&amp;#39;s happening is that Appian is trying (and &lt;em&gt;&lt;strong&gt;failing&lt;/strong&gt;&lt;/em&gt;) to automatically cast a TEXT value like &amp;quot;2022-08-19 06:24:00&amp;quot;, to the &amp;quot;Date and Time&amp;quot; data type as seen in your CDT.&amp;nbsp; Like I and others were saying above, appian &lt;em&gt;&lt;strong&gt;can not and will not&lt;/strong&gt;&lt;/em&gt; auto-convert an &amp;quot;ISO&amp;quot; text-based timestamp in this format to DateTime - you MUST do it yourself (unfortunately).&lt;br /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661176770236v2.png" alt=" " /&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661176927525v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;So once again, to fix the above, you will need to alter your expression rule so that these properties are properly converted *first*, before calling the rule in your process model.&lt;/p&gt;
&lt;p&gt;As an aside: I have no idea what the result will be if you read an Excel cell where the value is merely the &amp;quot;today()&amp;quot; function.&amp;nbsp; Best case scenario is that it&amp;#39;ll always return the current day&amp;#39;s date, but I have seen no evidence that would lead me to believe this would work as-is, without testing first (which I haven&amp;#39;t done).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99884?ContentTypeID=1</link><pubDate>Mon, 22 Aug 2022 08:09:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0d5bf4ea-fd47-4311-a7d3-b0f6f534b1e2</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;thanks for this Mike,&lt;/p&gt;
&lt;p&gt;I have encountered one more issue while trying to save my excel data to database&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;While Reading the excel/csv file the time field does not comes up while testing the expression rule. I am giving a date time field in excel/csv Also i have tested it by formatting of the excel cells to date time value.&lt;/li&gt;
&lt;li&gt;If i am giving today function in excel/csv i am getting the data in expression rule and the process works successfully, but if I am giving some other date, the expression rule gives correct results, but my process fails.&lt;/li&gt;
&lt;li&gt;I have attached screenshots of the same&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661155169771v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Here I have used general format as well as date time format&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661155458515v2.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;In the above pic I have just passed the time value and tested in the rule gives me date time value&lt;/p&gt;
&lt;p&gt;process model:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661155572418v3.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;process variable where the expression rule being called:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661155629542v4.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;what could be the reason behind extra time value coming and improper date format coming in process variable.&lt;/p&gt;
&lt;p&gt;Error:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/pastedimage1661155720419v5.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Kindly Help.&lt;/p&gt;
&lt;p&gt;Thank You.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99731?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 13:32:35 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:44c54335-256a-4f89-bf2b-7f95815bd990</guid><dc:creator>Mike Schmitt</dc:creator><description>&lt;p&gt;For anyone dealing with timestamps in ISO format, I suggest making a handler expression rule in your system to automatically do such things (reducing the unnecessary and repetitive use of potentially clunky-looking code on an interface or in an unrelated handler rule like the above).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve created this example in the past which uses regEx merely to check that the timestamp being passed in is valid ISO format (and can optionally handle seconds in the timestamp, in case that&amp;#39;s ever needed), then uses logic much like Deepak&amp;#39;s example here (but using more local variables to reduce function repetition) to create an Appian dateTime value out of the result.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="java"&gt;/* rule!GENERAL_Utility_parseIsoDateTime */
if(
  or(
    a!isNullOrEmpty(ri!dateTimeString),
    not(regexmatch(
      pattern: &amp;quot;[12]\d\d\d-[01]{0,1}\d-[0123]{0,1}\d [012]\d:[012345]\d(:[012345]\d)?&amp;quot;,
      searchString: ri!dateTimeString,
      regexFlags: &amp;quot;s&amp;quot;
    ))
  ),
  null(),
  
  a!localVariables(
    local!parts: split(ri!dateTimeString, &amp;quot; &amp;quot;),
    local!dateParts: split(local!parts[1], &amp;quot;-&amp;quot;),
    local!timeParts: split(local!parts[2], &amp;quot;:&amp;quot;),
    local!gmtTime: datetime(
      local!dateParts[1],
      local!dateParts[2],
      local!dateParts[3],
      local!timeParts[1],
      local!timeParts[2],
      index(local!timeParts, 3, 0)
    ),
    
    if(
      ri!fromGmt,
      local!gmtTime,
      gmt(local!gmtTime)
    )
  )
)&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;@OP: you&amp;#39;d need to create local variables before your cast() operation where you convert the timestamp values into dateTime values - then simply call those local variables within your cast() operation instead of i.e. &amp;quot;fv!item[13]&amp;quot;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99730?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 13:22:20 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b3d77c85-89fe-4512-a080-2de597e92bf7</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;Are you looking for something like below?&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!a: &amp;quot;8/17/22 17:00&amp;quot;,
  left(
    datetime(
      split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;/&amp;quot;)[3],
      split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;/&amp;quot;)[1],
      split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;/&amp;quot;)[2],
      split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[1],
      split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[2],
      0
    ),
    len(
      datetime(
        split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;/&amp;quot;)[3],
        split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;/&amp;quot;)[1],
        split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;/&amp;quot;)[2],
        split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[1],
        split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[2],
        0
      )
    ) - 10
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99725?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 12:29:27 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:37d250c6-1997-4f37-a47e-406b7656ccf6</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;I have provided a snap of excel also you can use the same value for 4, 5 &amp;amp; 6th column&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99721?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 12:26:19 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3f34fa3f-f1a5-4f1b-b583-33044401d193</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;did you try the above code? Could you please share the value of your local variable for the 4,5 and 6th columns?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99718?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 12:24:13 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:273b1daf-c9b7-476a-8543-e580e9f6be86</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;same value as 4th column if I pass the date to 5t or 6th column I am getting error like Date out of range.&lt;/p&gt;
&lt;p&gt;Also I want, timestamp without time zone for efv_bgn_ts and effv_end_ts&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99711?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 12:10:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4f80c8d4-fc07-4986-956a-b5d5ec7cc00f</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;Could you please show me the value of local!recordSet1 of index 1st. Basically i want to see the 5th or 6th column values from the excel read function.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Most probably we have to use the below code:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;a!localVariables(
  local!a: &amp;quot;2004-04-13 14:09:20&amp;quot;,
  datetime(
    split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;-&amp;quot;)[1],
    split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;-&amp;quot;)[2],
    split(split(local!a, &amp;quot; &amp;quot;)[1], &amp;quot;-&amp;quot;)[3],
    split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[1],
    split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[2],
    split(split(local!a, &amp;quot; &amp;quot;)[2], &amp;quot;:&amp;quot;)[3]
  )
)
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Local!a will be your datetime column index.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99709?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 11:59:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:daf7c779-a13d-4b82-a2da-51bc79e9218b</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;Attaching the snap of my rule&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/5444.Date3.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99707?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 11:56:43 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6e2e4c2d-3db3-47b7-8a25-e8c069e56ae7</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;I am attaching whole snap of my rule just let me know where do I need changes and which format should I pass in excel&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/Date3.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99704?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 11:28:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:72cebc42-1db1-415b-9202-f4f2765e4d5a</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;you have to modify the date format first and then use todatetime. for that you have to see your local variable data.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99703?ContentTypeID=1</link><pubDate>Thu, 18 Aug 2022 10:39:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4cc46e6b-32a7-4ec9-a32f-e5bf1720eab4</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;Hi deepak,&lt;/p&gt;
&lt;p&gt;I try to cast the values as per CDT but giving this error. I am passing date as MM-DD-YYYY HH:MM:SS AM/PM.&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/Date1.PNG" /&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/Date2.PNG" /&gt;&lt;/p&gt;
&lt;p&gt;NOTE: I am using postgres DB&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99647?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 16:30:47 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:679ab53c-e7b7-49ba-a82c-7c6f59e8eae4</guid><dc:creator>deepakg271869</dc:creator><description>&lt;p&gt;You have to use toDatetime function to cast it into Date and Time type.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99628?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 13:57:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:758cdf3b-4e62-404b-afd1-9a551c34383f</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;Attaching sample code&lt;/p&gt;
&lt;p&gt;&lt;img alt=" " src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/62/6305.Capture11.PNG" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99622?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 13:26:22 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e07d9ed0-076c-4cec-b9c8-1c2ee3dcc279</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;I need to see how you have configured the casting expression rule. Please attach the code or screenshot of it.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99619?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 13:22:40 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9a4c9b0f-5de3-4e52-ab48-fb63db0a79fe</guid><dc:creator>kirang100133</dc:creator><description>&lt;p&gt;Hi Harshit,&lt;/p&gt;
&lt;p&gt;Format of the date is fine, whenever I add (8/17/2022 10:10:00) then the file is read by rule but the mapping is not happening for any values to CDT&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Rule to CDT</title><link>https://community.appian.com/thread/99617?ContentTypeID=1</link><pubDate>Wed, 17 Aug 2022 13:14:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:56ea378e-7366-4d4a-9d8d-819342687e7d</guid><dc:creator>Harshit Bumb (Appyzie)</dc:creator><description>&lt;p&gt;Hi Kiran,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Can you also attach a screenshot of the mapping rule/code you are using to task this dict to CDT?&amp;nbsp;&lt;br /&gt;To me, it looks like you might need to change the format of the date, or maybe the datatype of the field in CDT is misconfigured.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>