If Script in workflow for finding change variable in catalog item
						
					
					
				
			
		
	
			
	
	
	
	
	
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
2 weeks ago
Hi Team,
Good morning,
My requirement is we have a variable called " I change" in the catalog item, now the if script is true(yes) when we update the value , when user select an existing application in the catalog item they update other than I change field it will false(no) , can anyone please help me on this.
Thanks
Dhanu
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
2 weeks ago
Hi @Dhanu1 ,
I tried your problem in my PDI and it is working fine
please check below solution
Create 2 fields 1. I Change type is Checkbox. 2. Application - type Reference your specific table
Create Catalog client script
Type - OnChange of Application field and add below code
function onChange(control, oldValue, newValue, isLoading) {
    if (isLoading || newValue == '') {
        return;
    }
    alert("Here");
    g_form.setValue('i_change', true);
}
Result
When I didn't change application I change field is false
When I change Application, I change field is true
Please mark my answer correct and helpful if this works for you
Thanks and Regards,
Sarthak
- Mark as New
 - Bookmark
 - Subscribe
 - Mute
 - Subscribe to RSS Feed
 - Permalink
 - Report Inappropriate Content
 
2 weeks ago
you didn't share your code, screenshots.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
