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

Kieran Anson
Kilo Patron

have you added logging statements to see what value prjArea is returning? It's hard to advise on the structure you'd need to dot walk with it being custom. You should also be passing back the sys_id of the assignment group instead of the name.

Rather than scripting it, you could do this in steps just with a branch.

Nihar1
Giga Contributor

Hello Kieran,

Thanks for the response.

I am completely new to this.

Can you help me how do I add the loging information.

Please give me some example. 

You can use gs.log() or gs.warn() to write outputs to the log table

gs.warn("Value is " + prjArea);

Hello Kieran,

I tried putting log also nut it looks like it is erroring and not capturing any error .

Here is the screen shots.

find_real_file.png

 

 

 

If I click on the Open Flow log nothing is showing 

find_real_file.png

Here is the script .

assignment_group=/*
**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 prjArea1 = fd_data._1_4__update_record.record.u_project_area.getDisplayValue();
gs.log("Value is " + prjArea1);
var prjArea = fd_data.trigger.current.parent.u_project_area.getDisplayValue();
gs.log("Value is prjArea " + prjArea);
var values = '';
if(prjArea == 'Oracle EBS: Idea to Opportunity (I2O)'){
    values = '9e6741581b70b3004785964ead4bcbcb';
}else {values = 'f9c0881edb004810532b14723996193f';}
gs.log("Value is values " + values);
return values;