Prepopulate values in multifield | Community
Skip to main content
rk39193348
Level 4
May 2, 2017
Solved

Prepopulate values in multifield

  • May 2, 2017
  • 3 replies
  • 1575 views

 Hi,

I have a scenario where I need to prepopulate values inside multifield. How to achieve this? Please help?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Naresh_Katkam

Hi

you have to write loadcontent event js to prepopulate values.

In JS you have to add a item first based on the condition check and add values to that multifield.

example:

loadcontent js

if(multifield.getValue()=='')

{

     multifield.addItem();

     if{

          here you can write your logic to set prepopulate values.

}

if you need any further help. just let me know.

Thanks.

3 replies

rk39193348
Level 4
May 2, 2017

rk39193348 wrote...

 Hi,

I have a scenario where I need to prepopulate values inside multifield. How to achieve this? Please help?

 

Also I need the values entered inside my multifield to stay in dialog. How to achieve this?

My dialog contains 9 text field and 1 dropdown field inside multifield. The values should be prepopulated inside the dialog

James_R_Green
Level 6
May 4, 2017

Hi,

Do you mean the "Drop-down List" Adaptive Form component with Allow multiple selection checked?

If so, you can just configure with the spanner and add options under the items property.

Or you can add them with javascript using the Rules editor (hammer tool) and populate with code similar to this:

 
    
    var testValues = ["1", "2", "3"]; this.items = testValues;
 
Naresh_KatkamAccepted solution
Level 2
November 4, 2017

Hi

you have to write loadcontent event js to prepopulate values.

In JS you have to add a item first based on the condition check and add values to that multifield.

example:

loadcontent js

if(multifield.getValue()=='')

{

     multifield.addItem();

     if{

          here you can write your logic to set prepopulate values.

}

if you need any further help. just let me know.

Thanks.