Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Inline script on flow designer.

Nihar1
Giga Contributor

Hello Team,

I am not able to achieve one logic. keep struggling to put the logic.

By using the flow designer I am able to create multiple task and associated the  task to one project.

The Requirment is depending on the project area (Custom field enabled ) I needs to populate the task assignment group.

 

find_real_file.png

find_real_file.png

Under the script I wrote bellow inline script .

But it is not returning any thing. 

Here is the sciript.

 

It is always returning the else part value the if condition value is correct.

 

find_real_file.png

/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var prjArea = fd_data.trigger.current.parent.u_project_area.getDisplayValue();
if(prjArea == 'Oracle EBS: Idea to Opportunity (I2O)'){
return'Approvers Project G1 Oracle EBS I2O';
}else {retun 'Approvers Project G1 Oracle EBS OBIEE';}

 

8 REPLIES 8

Is this within a scope other than global? gs.log can't be used in scoped applications.

find_real_file.png

find_real_file.png

I do not see it has any other scope.

I found the log by the way it is erroring in the inline script .

here is the log.

Operation(Project Flow.If$1.d9706bdc1bc3ecd04785964ead4bcb8b.11706bdc1bc3ecd04785964ead4bcbba.InlineScript_assignment_groupa970abdc66c3ecd03d384737bc1df80d) failed with error: com.snc.process_flow.exception.OpException: Error: Cannot convert null to an object.,Detail: Cannot convert null to an object.
at com.snc.process_flow.operation.script.ScriptOperationBase.handleScriptResult(ScriptOperationBase.java:54)
at com.snc.process_flow.operation.script.ScriptOperationBase.runScript(ScriptOperationBase.java:46)
at com.snc.process_flow.operation.script.ScriptOperation.run(ScriptOperation.java:64)
at com.snc.process_flow.engine.Operation.execute(Operation.java:106)
at com.snc.process_flow.engine.ProcessEngine.executeOps(ProcessEngine.java:386)
at com.snc.process_flow.engine.ProcessEngine.run(ProcessEngine.java:334)
at com.snc.process_flow.engine.ProcessAutomation.run(ProcessAutomation.java:57)
at com.snc.process_flow.engine.GlideProcessAutomation.runSync(GlideProcessAutomation.java:126)
at com.snc.process_flow.engine.GlideProcessAutomation.lambda$runAsUserSync$1(GlideProcessAutomation.java:213)
at com.snc.process_flow.engine.GlidePFSession.runPlanAsUserSession(GlidePFSession.java:26)
at com.snc.process_flow.engine.GlideProcessAutomation.runAsUserSync(GlideProcessAutomation.java:205)
at com.snc.process_flow.engine.GlideProcessAutomation.messageFlow(GlideProcessAutomation.java:242)
at com.snc.process_flow.engine.ProcessHubEventHandler.doSendMessage(ProcessHubEventHandler.java:284)
at com.snc.process_flow.engine.ProcessHubEventHandler.process(ProcessHubEventHandler.java:69)
at com.glide.policy.EventProcessor.processEventDuringNormalOperation(EventProcessor.java:213)
at com.glide.policy.EventProcessor.processEvent(EventProcessor.java:138)
at com.glide.policy.EventProcessor.process(EventProcessor.java:92)
at com.glide.policy.EventManager.processEvents(EventManager.java:291)
at com.glide.policy.EventManager._process(EventManager.java:166)
at com.glide.policy.EventManager.processDelegatedEvents(EventManager.java:140)
at com.snc.process_flow.engine.PFJob.execute(PFJob.java:17)
at com.glide.schedule.JobExecutor.lambda$executeJob$0(JobExecutor.java:108)
at com.glide.schedule.JobExecutor.executeJob(JobExecutor.java:111)
at com.glide.schedule.JobExecutor.execute(JobExecutor.java:95)
at com.glide.schedule_v2.SchedulerWorkerThread.executeJob(SchedulerWorkerThread.java:329)
at com.glide.schedule_v2.SchedulerWorkerThread.lambda$process$0(SchedulerWorkerThread.java:192)
at com.glide.worker.TransactionalWorkerThread.executeInTransaction(TransactionalWorkerThread.java:35)
at com.glide.schedule_v2.SchedulerWorkerThread.process(SchedulerWorkerThread.java:192)
at com.glide.schedule_v2.SchedulerWorkerThread.run(SchedulerWorkerThread.java:100)

 

 

 

Hi,

"Cannot convert null to an object" somewhere in the chain of your dot walking a field doesn't have a value. Is u_project_area populated?

Hello Kieran,

I was able to got it through the GlideRecord on PM_PROJECT.

Thanks for pointing out the dot walking issue . It is not able to populated in that filed value.

So I decided to go through the GlideRecord route.