Binding a string variable as text in a DropDownBox DataProvider

Hi,

I would like to take a text input, saved in a string variable, from the user interface and bind as an option in a DropDownBox. The text input should be changable real time and the DropDown option should also be updated to match this text input. How can I do this?

Basically I would like to do this (which doesn’t work):
name :=‘userName’;
itemCollection[0] := ‘{“value”:“0”,“text”: name}’;

and get the following result in the itemCollection in the Watch and bind it to the DataProvider of the DropDownBox :
itemCollection[0] = ‘{“value”:“0”,“text”: userName}’

I used to do this in VC4, where the data was bound by a simple string array and not the key/value pairs, and I now have to recreate this functionality in mappView.

Thanks in advance!

Hi Almida,

There are some previous Community posts on this topic:

It looks like this can be done with either OpcUA variables (which would show up in the Watch Window) or Session variables (which are handled entirely in mappView).

You mentioned that you tried something and it doesn’t work. What did you try and what issues did you run into?

Thanks, I found the solution with help of the first post that you linked, using strcat/concat to convert the variable into string for the drop down list.