<?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>Usage of Load()within with()</title><link>https://community.appian.com/discussions/f/user-interface/13049/usage-of-load-within-with</link><description>Hello Folks, 
 
 can anybody give me a use case/ scenario where load() function is used within a with() function. 
 
 Thanks In Advance. 
 
 Regards, 
 Amit</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/61265?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 17:45:56 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:de1fa156-a35d-44f2-a42b-6d22374f41e9</guid><dc:creator>ravir0001</dc:creator><description>Hi Amit,&lt;br /&gt;
&lt;br /&gt;
Here are my inputs on this.&lt;br /&gt;
&lt;br /&gt;
Analysis 1 :&lt;br /&gt;
variables declared inside load function - initiates once and value will be cached throughout the SAIL interface&lt;br /&gt;
variables .declared inside with function - can be initiated first and reevaluates each time based on the dynamic logic(s) in the SAIL interface.&lt;br /&gt;
&lt;br /&gt;
Analysis 2 :&lt;br /&gt;
Load() function= a local variable&amp;#39;s variable is only calculated the first time the expression is evaluated.&lt;br /&gt;
With() function= a local variable&amp;#39;s value is re-calculated when the expression is reevaluated .&lt;br /&gt;
Please visit the below link :&lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/17.4/fnc_evaluation_load.html"&gt;docs.appian.com/.../fnc_evaluation_load.html&lt;/a&gt; &lt;a href="https://docs.appian.com/suite/help/17.4/fnc_evaluation_with.html"&gt;docs.appian.com/.../fnc_evaluation_with.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Analysis 3 :&lt;br /&gt;
load() = load the locally declared variables one-time when the task is issued. To update a load variable, a save event must save into the local variable.&lt;br /&gt;
with() = load the locally declared variables each time there is a change in the form (such as field input).&lt;br /&gt;
&lt;br /&gt;
Analysis 4:&lt;br /&gt;
Load() calculates local variables value only first time when the expression is evaluated and With() re-calculates local variable&amp;#39;s value when the expression is reevaluated&lt;br /&gt;
&lt;br /&gt;
Analysis 5:&lt;br /&gt;
Load is used in expressions for SAIL interfaces to allow for user interaction on the SAIL, such as sorting or paging through a grid.&lt;br /&gt;
With() differs from the load() function because it recalculates the local variable values when the expression is re-evaluated.&lt;br /&gt;
&lt;br /&gt;
If an expression requires multiple evaluations of a complex value, you can use the with() function to define the value as a local variable, so it&amp;#39;s only evaluated once.&lt;br /&gt;
&lt;br /&gt;
Analysis 6:&lt;br /&gt;
&lt;br /&gt;
Differences :&lt;br /&gt;
1. You can define multiple local variable either Inside load() or with() but you can&amp;#39;t perform save operation over the variables which are defined inside with() whereas we can save the data into a variable which is defined inside load()&lt;br /&gt;
2.Performance wise load() is faster than with() because of only once execution.&lt;br /&gt;
3.Variables defined in load() instantiate for only once whereas variables defined in with() will be evaluated for each interaction on form, like sort, search, input a value in field etc. However forcefully you can dynamically change the value of the variables defined on load() as well.&lt;br /&gt;
&lt;br /&gt;
Hope the above may help you to understand better regarding Load() &amp;amp; with().&lt;br /&gt;
&lt;br /&gt;
Thanks,&lt;br /&gt;
Ravi.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/61263?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 17:32:28 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:ad9a9293-35d4-42cb-9c40-663465106ff8</guid><dc:creator>charlesm492</dc:creator><description>My apologies, I had the topic open from earlier and didn&amp;#39;t see the new response.  That&amp;#39;s an interesting case for sure.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/61260?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 17:09:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:a88be1f3-04d7-4443-8da1-f105b2ccabcc</guid><dc:creator>Josh</dc:creator><description>I just listed a valid use case. If your grid uses an expression to calculate some sort of value or show an icon, and that rule needs to be looped over, you could have a load() inside of the expression rule, thus a load() within the with() the paging grid is in.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/61255?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 16:35:14 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:212bb467-aac5-480a-bc05-c7c8553f6848</guid><dc:creator>charlesm492</dc:creator><description>As stated in this topic already, there shouldn&amp;#39;t be any valid use cases for a load() inside of a with(), unlike the opposite scenario, which definitely has its uses.  In a paging grid, for example, you have the grid itself saving into pagingInfo variable in the load() and the dataSubset variable re-evaluating in the with() using the pagingInfo.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/61242?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 14:46:48 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:2744f259-1de1-4c9a-9993-dab1eae2c665</guid><dc:creator>Josh</dc:creator><description>with() variables also are initialized on page load. An example use case would be a paging grid that loops over an expression that contains a load. Your paging grid would be within a with() so that your datasubset can be updated whenever you pagingInfo changes, and the looping function that paging grid uses has a load variable to cache information and make it accessible across all evaluations of the expression.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/61234?ContentTypeID=1</link><pubDate>Fri, 05 Oct 2018 13:58:11 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:c1351a08-65e6-4c91-afa2-5cc366abaf92</guid><dc:creator>laurenc20</dc:creator><description>Load() will occur before the with() as load variables evaluate when the page loads and with variables evaluate every time something happens on the page. I do not know of a scenario where it would make sense to need to put a load() inside of a with()&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58820?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 08:27:38 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:894eef8d-a8ed-4fa2-b6a5-51f65a03f15e</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;Hello Amit,&lt;/p&gt;
&lt;p&gt;Please go through earlier discussion&amp;nbsp;&lt;a href="/discussions/f/user-interface/11603/load-and-with-function-difference"&gt;https://community.appian.com/discussions/f/user-interface/11603/load-and-with-function-difference&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58813?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 07:11:49 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:b207c7b0-1311-4feb-ab01-34b4113311b8</guid><dc:creator>saivineeths</dc:creator><description>Variables defined in load() evaluated only once whereas variables defined in with() will be evaluated for each interaction on form,However forcefully you can dynamically change the value of the variables defined on load() as well.But Performance wise load() is faster than with().you can&amp;#39;t perform save operation over the variables which are defined inside with().&lt;br /&gt;
Any consistent values should be maintained in the variables defined in load(),and variables which are expected to change its value based on given input should be defined in with().&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58811?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 06:33:00 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:36c477d4-b9ba-40d7-b373-e87a97829f34</guid><dc:creator>Preji P</dc:creator><description>Hi Amit,&lt;br /&gt;
To understand the actual difference on both functions I would suggest you to use one function at a time and see how the Appian respond to you.&lt;br /&gt;
&lt;br /&gt;
With just load() in your logic you can see the details in a form is loaded only once i.e. at the time of initial load.&lt;br /&gt;
that means you wont be able to see any dynamic changes in your form with whatever selection you make in form and hence it is advisable t use load() only where you wish to populate details at first and should not change after once its loaded.&lt;br /&gt;
&lt;br /&gt;
Now with with() you can see your form dynamically changes with the details selected in the form (for an example consider based on your country selection the field for phone code automatic changes ) for such logic  you should be using with().&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I hope this would help you better understand about both the function.&lt;br /&gt;
&lt;br /&gt;
Thanks.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58809?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 05:22:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6ea490df-a030-4c43-b5e7-0ee301a3268a</guid><dc:creator>amits0004</dc:creator><description>Thanks Guys for the replies.&lt;br /&gt;
&lt;br /&gt;
Regards,&lt;br /&gt;
Amit&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58807?ContentTypeID=1</link><pubDate>Tue, 07 Aug 2018 04:28:53 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:be2e343a-15a4-4ec8-8d76-21c396eec24f</guid><dc:creator>ravalik</dc:creator><description>Hi  amits,&lt;br /&gt;
&lt;br /&gt;
Please find the below link.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="https://docs.appian.com/suite/help/18.2/fnc_evaluation_load.html"&gt;docs.appian.com/.../fnc_evaluation_load.html&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58794?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 16:55:05 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f2c7cb9a-9ba4-409d-966b-fcbe1846901f</guid><dc:creator>Mike Schmitt</dc:creator><description>As far as I&amp;#39;ve ever been able to tell, the only thing that matters regarding placement of load() and with() is the actual variables that you declare in them, and where you need those variables used.&lt;br /&gt;
&lt;br /&gt;
I&amp;#39;ve heard people claim for a long time that &amp;quot;code contained inside a with() re-evaluates&amp;quot;, but I think this might be a bit misleading as it&amp;#39;s just the with() variables themselves that re-evaluate, and then any components using these will adjust as necessary.&lt;br /&gt;
&lt;br /&gt;
load() is usually placed outside the scope of a with() variable as load() variables (at any level) only automatically evaluate once per form load, and thereafter their values only adjust when manually pushed from a component.  the with() section (if any) is usually done inside this as it most likely needs to refer to load() variables and their potentially changing values (as changed by user input etc).  But none of this is strictly required.  You can have a load() and no with(), or a with() and no load(), or any combination of them at various levels, as long as they do what you  need.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58778?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 13:08:01 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:588ff4ca-a5b3-46b5-b170-acac33781dd6</guid><dc:creator>krishnau3863</dc:creator><description>Hi amits0001,&lt;br /&gt;
&lt;br /&gt;
      For better understanding follow the below link&lt;br /&gt;
&lt;a href="https://community.appian.com/discussions/f/user-interface/11603/load-and-with-function-difference/56363#56363"&gt;community.appian.com/.../56363&lt;/a&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58776?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 12:47:52 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:534a2ead-2503-42f5-8d2a-c6a01809429b</guid><dc:creator>lucasj</dc:creator><description>Any code inside of the with() is going to be automatically re-evaluated on each action (as well as the page load) anyway, so putting a load() inside of a with() is never necessary.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Usage of Load()within with()</title><link>https://community.appian.com/thread/58773?ContentTypeID=1</link><pubDate>Mon, 06 Aug 2018 12:02:32 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:9d9e6878-fada-47c1-813b-ae484817e59e</guid><dc:creator>josep</dc:creator><description>Hello Amit&lt;br /&gt;
&lt;br /&gt;
Everytime you load the page and you have some filters you place the filters dropdowns on the load (because you want to load them once. Even you can load the initial information to display on the grid, in this scenario you have to load the grid information again if the user clicks a button or sort the information on the grid. &lt;br /&gt;
&lt;br /&gt;
In the same scenario above if you want the information to be updated right away after the user changes the filter then you need to load all the filters In the load, and inside that load a “with” function loading the information for the grid. In this case you don’t need to wait until the user clicks the button. When the user changes the filter the information will be updated. &lt;br /&gt;
&lt;br /&gt;
One specific example for with. &lt;br /&gt;
You should use with as well in a expression rule on which you want to make some processing on the information and you want to split the logic in a “understable way”. to do that you need variables. In this case you want to ensure your variables get the proper values everytime you call the rule, let’s say in the same screen. To ensure that all the variables in that rule should be created within a “with”.&lt;br /&gt;
&lt;br /&gt;
Hope this helps &lt;br /&gt;
&lt;br /&gt;
Jose&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>