Fill the demo data in SAIL on click of a Button.

Certified Senior Developer

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 some thoughts on this, if possible some sample form.

We don't want to send the data from Process because we don't want to fill the form with default data.

Thanks in advance.

-Ram

  Discussion posts and replies are publicly visible

Parents
  • HI,

    I am describing a method to populate demo data.

    1. Create a local variable in load() in SAIL code. It can be a CDT or a dictionary (adhoc data structure). Example: local!formData 
    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
    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.
    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 "Populate data". 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)

    Once the user clicks on the "Populate data" button, the demo data will be populated.

    The above method I have suggested does not require any database data or process data.
    We are simply using local variables.

    In fact - this is also a good way to prototype SAIL forms and test them as you are developing them.
    You can start developing SAIL forms before the related process models/CDTs are created/database schema is finalized using this method.

Reply
  • HI,

    I am describing a method to populate demo data.

    1. Create a local variable in load() in SAIL code. It can be a CDT or a dictionary (adhoc data structure). Example: local!formData 
    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
    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.
    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 "Populate data". 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)

    Once the user clicks on the "Populate data" button, the demo data will be populated.

    The above method I have suggested does not require any database data or process data.
    We are simply using local variables.

    In fact - this is also a good way to prototype SAIL forms and test them as you are developing them.
    You can start developing SAIL forms before the related process models/CDTs are created/database schema is finalized using this method.

Children
No Data