Need help of clear a list collector variable
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2023 10:58 PM
Hello,
Could someone please suggest on how to clear/empty a list collector variable after form loaded using catalog client script? I'm familiar UI Policies, but needed to learn using client script.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 11:33 PM
Here is my list collector name: approverList
Where do I need replace it in the code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-20-2023 11:08 PM
Hello @Erica2
Greetings!
Could you please elaborate your question. I believe When the form is loaded, the list collector would be empty. because no selection is made by user
refer below thread if it helps your scenario;
please mark the answer as correct and helpful if helped.
Kind regards,
Ravi Chandra.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 07:33 PM
Hello @Ravi Chandra_K
The list collector is currently uses for request approval. Once selected values(approvers) have been sent, we would like to clear out the list so that user have an option to select additional approvers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 09:56 PM
var variableName = 'list_collector_var';
g_form.setValue(variableName, []);
g_form.addInfoMessage('List collector variable cleared.');
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-21-2023 11:32 PM
Hello @Harish Bainsla
I tried the following code, but I have no luck of getting it to works: