How use one field of a form to populate other fields?

1
0
-1

Hello Bonita Community,

Right now, I have a form variable of type external API called customersList. It is a list of objects. In my form, I have a Customer Name and Customer Id. For the Customer Name, I use an auto-complete widget. So, when I type something in the Customer Name field, it will give me a list of suggestions. When I click on one of the suggestion, I want the Customer Id field automatically populated with the information corresponding to the name I choose.

For example, the first object of a customersList variable which is:
customersList[0] = { "customerName" = "One Time Customer", "customerNumber" = "0000" }
Thus, when I choose Customer Name field to be One Time Customer, I want the Customer Id to be set to 0000 automatically.

populated-Field.png

This is my form:

customer-Id-Field2.png

I set the value of the Customer Id field to be customersList[0].customerNumber. But, it is static.
(please note: customerNumber represents Customer Id)

Any tips on how to do it?

Thank you very much for your time,
Virak

1 answer

1
0
-1

Hi,

You face a limitation of the default autocompletion widget available in Bonita. In order to achieve your use case I recommend to use the contributed autocompletion widget available from the community: https://github.com/Bonitasoft-Community/widget_autocompletekey

Notifications