How to set Variable from g_modal using UI Action?
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
Hi,
I'm trying to set a variable from g_modal using a UI Action. The goal is to set the value from the button to the variable, but this doesn't work. If I try to save it to any field, then it works properly.
Any thoughts on how to save the value to a variable?
UI Action (client)
function onClick(g_form) {
var fields = [{
type: 'choice',
name: 'reason',
label: getMessage('Choose reason'),
value: getMessage(' -- Select -- '),
choices: [{
displayValue: 'Missing details',
value: 'missing_details'
},
{
displayValue: 'Urgent issue',
value: 'urgent_issue'
}],
mandatory: true
}];
g_modal.showFields({
title: "Select your reason",
fields: fields,
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('variables.reason', fieldValues.updatedFields[0].value);
g_form.save();
});
}
Modal:
Variable editor: empty when reason is seleted
0 REPLIES 0
