<?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>Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/discussions/f/user-interface/12920/fill-the-demo-data-in-sail-on-click-of-a-button</link><description>Hi, 
 we have requirement like on Button Click entire SAIL form(many fields) has to fill with some demo data. this will save a lot of time while giving the demo to client. 
 will it be possible to fill the data on click of a button? 
 Can you provide</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58084?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 12:28:41 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:db6c9b08-e595-428a-8658-407bd1d66638</guid><dc:creator>chetany</dc:creator><description>&lt;p&gt;In actual implementation - 90% of the times the data comes from rule inputs which come from activity class parameters of the user input task in the process model.&lt;br /&gt; The additional rule creation step that you have mentioned is just returning you a CDT. &lt;br /&gt; &lt;br /&gt; Please go through the approach I have suggested, in my approach I am already specifying to use the rule input of type CDT/dictionary.&lt;br /&gt; It is just the source of inputs to the SAIL components which in real projects also comes from rule input variables (and not expression rules).&lt;br /&gt; &lt;br /&gt;Now those rule input variables are passed by the caller (which maybe a user input task, another parent expression rule/a parent SAIL interface etc.)&lt;/p&gt;
&lt;p&gt;It&amp;#39;s up-to the caller to decide what and how to pass the rule inputs (any of the above methods).&lt;/p&gt;
&lt;p&gt;You never know in advance how it will be called in a real project implementation.&lt;/p&gt;
&lt;p&gt;So - creating an expression rule for just returning a test CDT instance offers no advantage.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58083?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 12:23:03 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:3956f6ac-566b-4edb-bfbd-a51ce444f5bf</guid><dc:creator>simples533</dc:creator><description>Logic to use rule is to assign value in Rule input - ri rather than Local variable, this will reduce efforts of Changing &amp;quot;value&amp;quot; attribute of each component after demo (real time implementation when developer must need to use ri to pass data in Process).&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58080?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 10:07:29 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:15d138dc-cd71-42cc-8beb-901ab739277b</guid><dc:creator>chetany</dc:creator><description>&lt;p&gt;There is no need to create the rule to return CDT value&lt;br /&gt; local variable in load created with type constructor should be fine.&lt;br /&gt; If say CDT is Employee, you can create local variable of type Employee like this:&lt;br /&gt; &lt;br /&gt; load(&lt;br /&gt; &lt;br /&gt; local!anEmployee: type!Employee( id: 123, name: abc, /*rest of CDT fields and values */ )&lt;br /&gt; &lt;br /&gt; /*rest of the code */&lt;br /&gt; )&lt;/p&gt;
&lt;p&gt;Note: if CDT is not created, you can use the dictionary (adhoc structure). Even CDT is not a must.&lt;br /&gt; &lt;br /&gt; &lt;br /&gt; And then you can save it in rule variable when the button is clicked.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58079?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 10:02:33 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f67672b9-e93c-40a8-9131-87105bb056df</guid><dc:creator>simples533</dc:creator><description>I hope you using CDT type variable on your form for all fields, if not then you need to do some hard work for each variable, else for CDT type, you can create a dummy rule (Lets say rule name : TEST_returnDummyData()) that return structure of your CDT along with dummy data, on click of button you can call this rule and populate your variable which is mapped to &amp;quot;Value&amp;quot; attribute of field. &lt;br /&gt;
&lt;br /&gt;
TEST_returnDummyData():&lt;br /&gt;
{&lt;br /&gt;
/*CDT Field Name : Dummy Value */&lt;br /&gt;
Name:&amp;quot;XYZ&amp;quot;,&lt;br /&gt;
Age:30}&lt;br /&gt;
&lt;br /&gt;
on button Click : &lt;br /&gt;
&lt;br /&gt;
a!save(ri!yourVariableName,rule!TEST_returnDummyData())&lt;br /&gt;
&lt;br /&gt;
Fields on Form : &lt;br /&gt;
&lt;br /&gt;
a!textField(&lt;br /&gt;
label:&amp;quot;Name&amp;quot;,&lt;br /&gt;
value:ri!yourVariableName.Name)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58078?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 09:45:25 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:660f08e5-1bd0-4ce3-8de3-8166ff3f29dc</guid><dc:creator>chetany</dc:creator><description>&lt;p&gt;HI,&lt;br /&gt; &lt;br /&gt; I am describing a method to populate demo data.&lt;br /&gt; &lt;br /&gt; 1. Create a local variable in load() in SAIL code. It can be a CDT or a dictionary (adhoc data structure). Example: local!formData&amp;nbsp;&lt;br /&gt; 2. Have a rule input of the same datatype to this SAIL interface. This has to be of same type as the variable created in #1&lt;br /&gt; 3. Assign the demo data (form data to this variable) by binding to rule input variable created in #2. Example: first textbox can be bound to ri!formData.name, second textbox to ri!formData.age etc. This will ensure that when the form is first opened it will be blank.&lt;br /&gt; 4. Have a button which when clicked will assign the local variable created in #1 to the rule input created in #2. Say the button name is &amp;quot;Populate data&amp;quot;. In this button, have a saveInto. In the saveInto, you can save the local variable created in #1 to the rule input created in #2. You will use the a!save() function for this. Example: a!save(ri!formData, local!formData)&lt;br /&gt; &lt;br /&gt; Once the user clicks on the &amp;quot;Populate data&amp;quot; button, the demo data will be populated.&lt;br /&gt; &lt;br /&gt; The above method I have suggested does not require any database data or process data.&lt;br /&gt; We are simply using local variables.&lt;br /&gt; &lt;br /&gt; In fact - this is also a good way to prototype SAIL forms and test them as you are developing them.&lt;br /&gt; You can start developing SAIL forms before the related process models/CDTs are created/database schema is finalized using this method.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58070?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 07:10:55 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:12c4f481-7223-4332-a956-d6414e102a02</guid><dc:creator>Shubham Aware</dc:creator><description>&lt;p&gt;I will suggest you better solution for demo.&lt;br /&gt;On form load pull old data from db and initialize local variable and on save into of first field initialize ri!varible(CDT type) and remaining value gets auto fill with respective field and value.&lt;br /&gt;No need to click on button.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58069?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 07:08:51 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:4938438d-0cfa-42cf-a816-12c2750ec45e</guid><dc:creator>deviratnamv</dc:creator><description>Hi Ram,&lt;br /&gt;
Yes, it is possible to fill the data on click of a button. Once try below code. It might be helpful for you.&lt;br /&gt;
load(&lt;br /&gt;
  local!Data:{Fullname:&amp;quot;abcdz&amp;quot;,Firstname:&amp;quot;efg&amp;quot;},&lt;br /&gt;
  a!formLayout(&lt;br /&gt;
    contents: {&lt;br /&gt;
      a!textField(&lt;br /&gt;
        label: &amp;quot;Full Name&amp;quot;,&lt;br /&gt;
        value: ri!fullName,&lt;br /&gt;
        saveInto: ri!fullName&lt;br /&gt;
      ),&lt;br /&gt;
       a!textField(&lt;br /&gt;
         label: &amp;quot;Firstname&amp;quot;,&lt;br /&gt;
        value: ri!firstName,&lt;br /&gt;
        saveInto: ri!firstName&lt;br /&gt;
      )&lt;br /&gt;
    },&lt;br /&gt;
    buttons: a!buttonLayout(&lt;br /&gt;
      primaryButtons: a!buttonWidget(&lt;br /&gt;
        label: &amp;quot;Submit&amp;quot;,&lt;br /&gt;
        saveInto: &lt;br /&gt;
        {a!save(&lt;br /&gt;
          ri!fullName,local!Data.Fullname&lt;br /&gt;
        ),a!save(&lt;br /&gt;
          ri!firstName,local!Data.Firstname&lt;br /&gt;
        )&lt;br /&gt;
        }&lt;br /&gt;
        &lt;br /&gt;
      )&lt;br /&gt;
    )&lt;br /&gt;
  )&lt;br /&gt;
)&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58058?ContentTypeID=1</link><pubDate>Wed, 18 Jul 2018 01:49:34 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:f377b59b-5c0f-4cb9-b2f9-eafb9c851c10</guid><dc:creator>jeromew</dc:creator><description>&lt;p&gt;Hi Ram,&lt;/p&gt;
&lt;p&gt;I do something similar for demos. There are a few different methods I&amp;#39;ve used:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;load(
  local!demoData,
  a!formLayout(
    label: &amp;quot;Demo&amp;quot;,
    contents: {
      a!sectionLayout(
        contents: {
          /*Populate from a button anywhere in the content*/
          a!buttonLayout(
            primaryButtons: {
              a!buttonWidget(
                label: &amp;quot;From Content Button&amp;quot;,
                style: &amp;quot;PRIMARY&amp;quot;,
                submit: false,
                saveInto: {
                  a!save(
                    local!demoData,
                    {
                      field1: &amp;quot;field1FromContentButton&amp;quot;,
                      field2: &amp;quot;field2FromContentButton&amp;quot;,
                      field3: &amp;quot;field3FromContentButton&amp;quot;
                    }
                  )
                }
              )
            }
          ),
          /*Populate from dynamic link*/
          a!linkField(
            label: &amp;quot;Link Field&amp;quot;,
            links: a!dynamicLink(
              label: &amp;quot;From Dynamic Link&amp;quot;,
              saveInto: {
                a!save(
                  local!demoData,
                  {
                    field1: &amp;quot;field1FromDynamicLink&amp;quot;,
                    field2: &amp;quot;field2FromDynamicLink&amp;quot;,
                    field3: &amp;quot;field3FromDynamicLink&amp;quot;
                  }
                )
              }
            )
          ),
          a!textField(
            label: &amp;quot;Field 1&amp;quot;,
            value: local!demoData.field1,
            saveInto: local!demoData.field1
          ),
          a!textField(
            label: &amp;quot;Field 2&amp;quot;,
            value: local!demoData.field2,
            saveInto: local!demoData.field2
          ),
          a!textField(
            label: &amp;quot;Field 3&amp;quot;,
            value: local!demoData.field3,
            saveInto: local!demoData.field3
          )
        }
      )
    },
    /*Populate demo data from form button*/
    buttons: a!buttonLayout(
      primaryButtons: {
        a!buttonWidget(
          label: &amp;quot;From Form Button&amp;quot;,
          style: &amp;quot;PRIMARY&amp;quot;,
          submit: false,
          saveInto: {
            a!save(
              local!demoData,
              {
                field1: &amp;quot;field1FromFormButton&amp;quot;,
                field2: &amp;quot;field2FromFormButton&amp;quot;,
                field3: &amp;quot;field3FromFormButton&amp;quot;
              }
            )
          }
        )
      }
    )
  )
)&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58055?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 20:48:12 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:6a038e4b-c7a9-4c87-858c-a3f3d5b050b0</guid><dc:creator>Shyam Bommakanti</dc:creator><description>Just a thought, You may be able to use Fitnesse for Appian to fill the form for you. This will be outside Appian and satisfies your requirement of not using default data.&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Fill the  demo data in SAIL on click of a Button.</title><link>https://community.appian.com/thread/58054?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 20:46:39 GMT</pubDate><guid isPermaLink="false">d3a83456-d57b-489c-a84c-4e8267bb592a:e9da23bb-567b-4e29-b4ef-8d63827e10a5</guid><dc:creator>Smruti Swain</dc:creator><description>&lt;p&gt;Hi Ram,&lt;br /&gt; You can still pass the data from the process and on click of a button you can fill those data across the form fields -OR- you can simply use a local variable and simply define the value inline.&lt;br /&gt; First you need to create a local variable that is used to fill out the form and assign the process variable (option#1) or defined local variable (option#2) to the local variable (used to fill out the form) in the saveInto of the buttonWidget.&lt;br /&gt; &lt;br /&gt; Here is how the form definition should look like for option#1.&lt;br /&gt; &lt;br /&gt; load(&lt;br /&gt; local!formData,&lt;br /&gt; &lt;br /&gt; a!formLayout(&lt;br /&gt; label: &amp;quot;Registration form&amp;quot;,&lt;br /&gt; contents: {&lt;br /&gt; a!textField(&lt;br /&gt; label: &amp;quot;Name&amp;quot;,&lt;br /&gt; value: local!formData.name,&lt;br /&gt; saveInto: local!formData.name&lt;br /&gt; ),&lt;br /&gt; a!textField(&lt;br /&gt; label: &amp;quot;DoB&amp;quot;,&lt;br /&gt; value: local!formData.dob,&lt;br /&gt; saveInto: local!formData.dob&lt;br /&gt; )&lt;br /&gt; },&lt;br /&gt; buttons: a!buttonLayout(&lt;br /&gt; primaryButtons: {&lt;br /&gt; a!buttonWidget(&lt;br /&gt; label: &amp;quot;Fill&amp;quot;,&lt;br /&gt; style: &amp;quot;PRIMARY&amp;quot;,&lt;br /&gt; submit: false,&lt;br /&gt; saveInto: {&lt;br /&gt; a!save(&lt;br /&gt; local!formData,&lt;br /&gt; ri!cdt&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; }&lt;br /&gt; )&lt;br /&gt; )&lt;br /&gt; )&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>