Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Prepopulate values in multifield

rk39193348
Level 4
Level 4

 Hi,

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

1 Accepted Solution
Naresh_Katkam
Correct answer by
Level 2
Level 2

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.

View solution in original post

3 Replies
rk39193348
Level 4
Level 4

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 7
Level 7

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_Katkam
Correct answer by
Level 2
Level 2

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.

View solution in original post