Flow designer - Set assignment group based on the field value contains sql or ora
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 06:02 AM
In a flow designer, For change task i need to set assignment group. I have written a script in flow designer for assignement group field. its not working
if a source_mssql_db_oracle_schema contains sql assugnment group should be AH_AHSAD_CHG_APP-DBA-SQL_L2
if a source_mssql_db_oracle_schema contains ora assugnment group should be
/*
**Access Flow/Action data using the fd_data object. Script must return a value.
**Order number is offset by +1 in Error Handling Section.
**Available options display upon pressing "." after fd_data
**example: var shortDesc = fd_data.trigger.current.short_description;
**return shortDesc;
*/
var source = fd_data.trigger.current.variables.source_mssql_db_oracle_schema.toString()
var assign = "";
gs.log("sunil source" + source);
var r = source.indexOf("ora");
var s= source.indexOf("sql");
var assgnsql=gs.getProperty("AH_AHSAD_CHG_APP-DBA-SQL_L2");
var orc=gs.getProperty("AH_AHSAD_CHG_APP-DBA-ORA_L2");
//gs.log("sunil source"+ r);
if (s >-1) {
gs.log("sunil sou s"+s);
assign="assgnsql";
}
// Check if the field contains 'Oracle'
if (r>-1) {
gs.log("sunil sou r"+r);
// Assign to the Oracle group
assign="orc";
}
return assign;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 11:49 AM
Hi @ChallaS
Do you get any value returned from your log statement?
Are your sys_property values sysIds of the assignment group?
Try getting the variables from Step1 (Get Catalog Variables) instead of the trigger record for line:
var source = fd_data.trigger.current.variables.source_mssql_db_oracle_schema.toString()
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 09:46 PM
Hi @Jon23
Thanks for the response
Logs are updating... But the assignment groups are not coming to the tasks
Are your sys_property values sysIds of the assignment group? yes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-18-2024 07:43 AM
Hi
Just looking at your script again and the issue is you are setting the 'assign' variable with a string and not the variable.
Try changing:
assign="assgnsql" to assign=assgnsql;
assign="orc" to assign=orc;
if (s >-1) {
gs.log("sunil sou s"+s);
assign = assgnsql;
}
// Check if the field contains 'Oracle'
if (r>-1) {
gs.log("sunil sou r"+r);
// Assign to the Oracle group
assign = orc;
}
return assign;