Copy variable 1(Reference) value to the other variable 2(list collector) on change of the variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 12:41 AM - edited 07-04-2023 12:42 AM
Hello All,
I need to copy variable 1 ( reference) value to variable 2(watch list).
If user updates the variable 1 value then the value should get updated in the watch list field i.e.., the earlier value present in watch list variable should be removed and should be populated with the new value selected in the variable.
NOTE: Both variables are part of variable set.
Is creating 2 client scripts a better option or if there is any better approach please guide me on this.
Thanks,
Raj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 12:55 AM
so if only variable 1 changes and that variable should be represent into variable 2 then only one onchange client script will be enough to handle this requirement.
g_form.clearValue('variable2');
g_form.setValue('variable_name2', newValue);
The above script is the sample code that you can use.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 01:12 AM
Hello @Mehta
Thanks for providing quick response.
The problem here is we cannot simple clear the value in Watch list variable as user can select multiple users along with these user's we need to populate the value selected in variable 1(Reference) if we user changes the value in variable 1 the value present in watch field(variable 2) should be removed and the remaining values should be present.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 03:03 AM
I have used setvalue to map the value to the Watchlist variable but to remove the value I'm not getting what needs to be done/updated.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 03:12 AM
I will share a script logic in sometime.