<?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>I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/discussions/f/data/1910/i-am-using-an-apply-function-to-build-sail-components-based-on-an-array-of-data</link><description>I am using an apply function to build SAIL components based on an array of data(CDT). Now that I have upgraded to 7.4 I plugged in the new integerField but receive the following error: &amp;quot;The load function cannot be used within rules called by looping functions</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/7038?ContentTypeID=1</link><pubDate>Sun, 26 Jan 2014 03:35:06 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f872e2fa-1a35-47eb-9e6b-23235008324a</guid><dc:creator>Annelise Dubrovsky</dc:creator><description>load() only has special behavior within a SAIL UI. For expressions that you use elsewhere, use with(), which  can be used within looping functions.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/7024?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2014 18:19:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ca7dd838-4afc-4afe-bbb8-0b44c7b7de03</guid><dc:creator>ryanh</dc:creator><description>I&amp;#39;ve found multiple references in the forums &amp;amp; release notes to the load() function not working anymore in 7.3/7.4 in certain looping functions.   &amp;quot;You cannot use this function within the Web Content Channel or a Looping Function or else an error occurs.&amp;quot;&lt;br /&gt;&lt;br /&gt;Alert error:&lt;br /&gt;&lt;br /&gt;There is a problem with task “Update Days In Process” in the process “ARG: Dev: Update Days in Process - ELAR # 90319”. ERROR:An error occurred while evaluating expression: =if(isnull(apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))),0,apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))) (Expression evaluation error at function &amp;#39;apply&amp;#39;: Error evaluating function &amp;#39;apply&amp;#39; : Expression evaluation error in rule &amp;#39;calculateholddurationforcollateralservice&amp;#39;: The load function cannot be used within rules called by looping functions. Instead, pass the necessary variables via rule inputs. Load variables found: local!collateralId, local!arrayOfPlaceOnHoldEvents, local!arrayOfTakeOffHoldEvents.) (Data Inputs)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Here is the primary function in question:&lt;br /&gt;&lt;br /&gt;=if(isnull(apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int))),0,apply(rule!roundDurationToDaysBase24,apply(rule!calculateHoldDurationForCollateralService,pv!theCollaterals_ArgCollaterals.collateralId_Int)))&lt;br /&gt;&lt;br /&gt;roundDurationToDaysBase24   =  Derives the integer number of days from a duration-type object. Will the number of days up if hours component of duration is greater than or equal to 12.&lt;br /&gt;= if(isnull(ri!duration),0,tointeger(ri!duration)+if((hour(ri!duration))&amp;gt;=12,1,0))&lt;br /&gt;&lt;br /&gt;calculateHoldDurationForCollateralService   = Returns the total duration (may be sum of several different periods) for which a specific collateral service (identified by parameter collateralId_int) has had the status of &amp;quot;On Hold&amp;quot;.&lt;br /&gt;&lt;br /&gt;=load(&lt;br /&gt;local!collateralId:ri!collateralId_int,&lt;br /&gt;local!arrayOfPlaceOnHoldEvents: rule!getOnHoldEventsForCollateralService(local!collateralId).timestamp_datetime,&lt;br /&gt;local!arrayOfTakeOffHoldEvents: rule!getHoldReleaseEventsForCollateralService(local!collateralId).timestamp_datetime,&lt;br /&gt;if(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;or(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;length(local!arrayOfPlaceOnHoldEvents)&amp;lt;1,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;isnull(local!arrayOfPlaceOnHoldEvents)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;0,&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;if(&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;length(local!arrayOfPlaceOnHoldEvents)=length(local!arrayOfTakeOffHoldEvents),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reduce(rule!sumDurations,now()-now(),apply(rule!calculateDuration,merge(local!arrayOfPlaceOnHoldEvents,local!arrayOfTakeOffHoldEvents))),&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;reduce(rule!sumDurations,now()-now(),apply(rule!calculateDuration,merge(local!arrayOfPlaceOnHoldEvents,append(local!arrayOfTakeOffHoldEvents,now()))))&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/7005?ContentTypeID=1</link><pubDate>Fri, 24 Jan 2014 03:26:59 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c16781a9-0680-47d1-87f6-2357fd0a7016</guid><dc:creator>matt.flanagan</dc:creator><description>Ryan, that shouldn&amp;#39;t happen. Can you attache a copy of the rule here and if it&amp;#39;s not something that I can execute on a clean environment a better description of what &amp;quot;fails&amp;quot; means? A screenshot or the exact error message would help.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/6997?ContentTypeID=1</link><pubDate>Thu, 23 Jan 2014 23:43:44 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0fbc647e-4ee3-4462-9cb8-323d4374872e</guid><dc:creator>ryanh</dc:creator><description>FYI, I have a rule that calls some functions using the load() and I can confirm that it runs fine on 7.2 and fails on 7.4.  This is on a standard portal based model that never touches Tempo or SAIL.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/6776?ContentTypeID=1</link><pubDate>Thu, 16 Jan 2014 05:56:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:39ec8d20-7048-40d3-b45e-5be677d945ff</guid><dc:creator>Annelise Dubrovsky</dc:creator><description>Take a look at this recipe on how to add and populate sections dynamically: &lt;a href="https://forum.appian.com/suite/wiki/74/SAIL_Recipes#Add_and_Populate_Sections_Dynamically"&gt;forum.appian.com/.../SAIL_Recipes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;It uses a!applyComponents to return SAIL sections, and also shows how you update fields of a CDT within each section.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/6754?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2014 20:08:24 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:0c125b89-16f0-43ac-9221-e4be489e2061</guid><dc:creator>Tim</dc:creator><description>Ok thanks for the pointer. This has broken all of the saveInto parameters. I&amp;#39;m passing in a CDT array but how can I save back into ri!cdt.value as I&amp;#39;ve lost control of the index&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: I am using an apply function to build SAIL components based on an array of data(</title><link>https://community.appian.com/thread/6751?ContentTypeID=1</link><pubDate>Wed, 15 Jan 2014 19:38:10 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f86fbfe1-9045-4c8f-9fb9-d1df95db6508</guid><dc:creator>matt.flanagan</dc:creator><description>You need to use the new a!applyComponents() function.&lt;br /&gt;&lt;br /&gt;&lt;a href="https://forum.appian.com/suite/wiki/74/Appian_Release_Notes#SAIL_Looping_Function_that_Supports_SAIL_Components"&gt;forum.appian.com/.../Appian_Release_Notes&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;a href="https://forum.appian.com/suite/wiki/74/System_Functions#a!applyComponents.28.29"&gt;forum.appian.com/.../System_Functions&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>