Configure Creating based on input given in previous task

Asmita7
Tera Expert

Hi friends,

Script inside if condition is :

answer = ifScript();
 
function ifScript() {
 
    if (current.variables.final_task == 'FINANCE') {
return 'yes';
    }
    return 'no';
}
 
But it does not work. How to fetch it and use ?
 

Please correct or suggest any other approach.

 

 

Thank you 

1 ACCEPTED SOLUTION

Also @Asmita7 ,

 

U can add one more if condition for the No path to include the 3rd scenario as well in this.

 

In that condition check if variable is HR then yes else nothing is selected then in that case simply create 2 task one after another in ur workflow.

 

Thanks,

Danish

 

 

View solution in original post

5 REPLIES 5

Danish Bhairag2
Tera Sage
Tera Sage

Hi @Asmita7 ,

 

You are correct. If condition needs to be used over here. U can fetch the value from the variable by doing current.variables.final_task n check if it's finance or HR n based upon that u can have 2 seperate paths created for respective task creation.

 

Thanks,

Danish

 

@Danish Bhairag2  ,

Thank you for your time.

 

I tried if condition with this code approach but it is not working. I have edited the question with workflow and the code inside if condition. Please check and suggest.

 

Thank you,

Hi @Asmita7 ,

 

Else is missing in this

 

function ifScript() {

 

    if (current.variables.final_task == 'FINANCE') {

return 'yes';

    }else{

    return 'no';

}

 

Thanks,

Danish

 

Also @Asmita7 ,

 

U can add one more if condition for the No path to include the 3rd scenario as well in this.

 

In that condition check if variable is HR then yes else nothing is selected then in that case simply create 2 task one after another in ur workflow.

 

Thanks,

Danish