- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 12:11 PM
Hi to everyone.
I'm trying to create a script client that emits an alert when the availability field record changes to reserved.
Can someone help me?
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var dis = g_form.getValue("availability");
if (newValue == "reserved") {
alert("Reserved room");
}
}
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 03:36 PM
Hi Lidi2115,
onChange() script is executed when the end-user opens the form or when the form is opened. It won't execute after the form is closed. That is, if the form is closed and flow designer changes the field, onChange() script won't execute.
If there is a need to get notified when a value is changed in Flow Designer, use notification to send email or send a message.
There is a "Send Notification" step in Flow Designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 02:03 PM
Hi Sachin,
I tried here, but it didn't work either.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-19-2022 03:36 PM
Hi Lidi2115,
onChange() script is executed when the end-user opens the form or when the form is opened. It won't execute after the form is closed. That is, if the form is closed and flow designer changes the field, onChange() script won't execute.
If there is a need to get notified when a value is changed in Flow Designer, use notification to send email or send a message.
There is a "Send Notification" step in Flow Designer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-20-2022 01:07 PM
Hi Hitoshi,
I need an alert (pop up) to appear on the user's screen when the form is closed and the flow designer changes the field to reserved.
That way the user would validate that the record was successfully added immediately and not by email.
Can I do it with the onSubmit() script? If yes, how?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2022 06:40 AM
function onSubmit() {
if (g_form.getValue("availability") == "reserved") {
alert("Reserved room");
}
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-21-2022 07:44 AM
>I need an alert (pop up) to appear on the user's screen when the form is closed and the flow designer changes the field to reserved.
My bad. Above script will only work when the end-user changes the field. It won't work when flow designer changes the field.
Showing alert on client's form page is not possible because Flow Designer executes on the server and not on the client pc.
The only alternative is to have Flow Designer send a notification. Notification can be a SMS and not an email notification. SMS notification will show up as an alert when the user is logged in.