
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:50 AM
Hi,
In the below script, what is the significance of newValue == '') { return; }. Kindly help.
Regards
Suman P.
function onChange(control, oldValue, newValue, isLoading, isTemplate) { if (isLoading || newValue === '') { return; ...
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:56 AM
Hi,
It determines that if on change of field value, if the new value is "" then, the script would not run. Similarly, isLoading signifies if the form is still loading then, script won't run further.
Regards,
Munender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:56 AM
Hellp Dava_P
newVaIue— Value of the control field after the change. For example, if the value of Assigned to changes from Runjay to Suman, the value of the parameter newValue will be Suman.
In the Scenerio, If newValue == ' ', that means, your value is not yet change or set to another value, it is still blank, so in that case flow logic will return nothing;
Plz Mark my Solution as Accept, If you got help or understanding from it.
Regards,
Samaksh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:56 AM
Hi,
It determines that if on change of field value, if the new value is "" then, the script would not run. Similarly, isLoading signifies if the form is still loading then, script won't run further.
Regards,
Munender

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 12:58 AM
@Community Alums This if check is usually placed in all the onChange client script to check if the form isLoading or if the new value is empty. As in both the cases, no further processing is needed and control can be returned to execute other scripts.
=== (Triple equals) is a strict equality comparison operator in JavaScript, which returns false for the values which are not of a similar type. This operator performs type casting for equality. If we compare 2 with “2” using ===, then it will return a false value.
Source: https://www.guru99.com/difference-equality-strict-operator-javascript.html
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-11-2023 01:04 AM
Hello @Community Alums
I have also given the Same Example of Script,
Can you plz mark my Solution as Accept, It will help other users to reach the post.
Regards,
Samaksh