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-05-2023 01:16 AM - edited 07-05-2023 01:16 AM
I have updated the code as below and it's partially working now the issue is if user updates the value in the variable 1 the value is getting removed from variable 2 on the first time(as it contains the value oldvalue).
If user tries to update the value in variable 1 without saving the form the value is getting mapped to variable 2(watch list) but if user try changing it to a different value the earlier value present in watchlist variable is not getting removed as the form is not saved yet it's not considering the newly added value as the old value.