The same requirement can be implemented in two ways: SQL in field linkage, or JavaScript in a code block.
Option 1: Field-Linkage SQL#
SELECT selectname
FROM workflow_selectitem
WHERE fieldid = '字段id'
AND selectvalue = 选项值;Replace 字段id with the select field ID and 选项值 with the current select option value. When the field linkage runs, the returned selectname is the display text to write into the target text field.
Option 2: Code-Block JavaScript#
WfForm.bindFieldChangeEvent("field44206", function(obj,id,value){ // 下拉框值改变时触发动作
var ccqy = WfForm.getSelectShowName("field44206"); // 获取下拉框显示值
WfForm.changeFieldValue("field68449", {value:ccqy}); // 赋值下拉框选项值给给文本字段
});field44206is the source select field.field68449is the target text field.getSelectShowNamereads the current display text of the select field.changeFieldValuewrites the display text into the target text field.
