You are viewing limited content. For full access, please sign in.

Question

Question

Modern Designer to use JS to add list values to drop-down

asked on February 21, 2024

Hi All,

We have checked a few items using the setFieldValues from the documentation adding an array of values, but it does not seem like it works with the Modern designer. Does anyone have a small example how to achieve this perhaps please?

 

This will be to connect API values from a 3rd party system, we can already get the API to work, but not to set the result value to a list. Even trying to use values from a collection or table, retrieving those items and then setting the drop-down using the setFieldValues. 

 

Any hints or advise will be appreciated.

 

Kind Regards,

Gert

1 0

Answer

SELECTED ANSWER
replied on February 21, 2024 Show version history

The LFForm.setFieldValues function can be used to select a value in a drop-down field, but not to change the available options.  To change the available options, you would use the LFForm.changeFieldOptions function (which works for checkboxes, radio buttons, and drop-downs).

The changeFieldOptions function was only added to the help documentation a week or so ago, so several of us initially were not aware of its existence, but it's there, and I've used it successfully.

Note that you will need Version 11 Update 5 (Version 11.0.2311...) to have this functionality, and I have been told it isn't currently available in LFCloud.

EDIT TO ADD: If you'd like an example, the file I attached to this comment on another post, is a simple multi-language form that includes editing options on a drop-down and a radio button.  The examples in the help documentation are pretty easy to follow too.

1 0
replied on February 21, 2024

Hi Matthew,

Great thanks, that seem to do the trick! Appreciate your help on this

2 0

Replies

You are not allowed to reply in this post.
You are not allowed to follow up in this post.

Sign in to reply to this post.