cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

How to send parameter values to SAC Data Action through Scripting

Vasu_Sac
Participant
0 Likes
1,753

Hi

How to send parameter values to SAC Data Action from Story Filters.

I have updated parameters with fixed values in script for data action and it is working, But I am looking to get user selected values from Story Filter to pass DA parameters instead of hard coded values.

How to get user selected values from Story filter and pass to DA parameters.

Vasu_Sac_0-1748875176060.png

Story Filters:

Vasu_Sac_1-1748875176061.png

Please help. Regards, Vasu

Accepted Solutions (0)

Answers (2)

Answers (2)

Ajit5
Newcomer
0 Likes

If the data action is being triggered via a story, you can pass the story filter through the Builder panel under the Parameters section.

William_Yu1
Product and Topic Expert
Product and Topic Expert
0 Likes

You check this script API to get dimension

var filter = Application.getFileDataSource(modelID).getDimensionFilters(dimensinonID);

Vasu_Sac
Participant
0 Likes

Hi @William_Yu1

Thanks for your reply.

I have updated below code and getting error while passing the variable value filter_C to setparameterValue function. If I use double or single quotes, the variable is not recognizing. If I remove quotes, its giving below error.

Vasu_Sac_0-1748954241222.png

Application.showBusyIndicator(" DA Executing...");

var filter_CC= Application.getFileDataSource("xxxxxxxxxxxxxxxxxxxxx").getDimensionFilters("CompCode")[0];
switch (filter_CC.type){
case FilterValueType.Single:
var filter_C = cast(Type.SingleFilterValue, filter_CC);
console.log(filter_C.value);
break;}

DataAction_1.setParameterValue("FYMonth_Input",'[Date].[FYP].&[202501]');
//DataAction_1.setParameterValue("CCODE_Input","100");
DataAction_1.setParameterValue("CCODE_Input",filter_C);
DataAction_1.setParameterValue("SalesGroup","SG1");
DataAction_1.execute();

Application.refreshData();
Application.hideBusyIndicator();
William_Yu1
Product and Topic Expert
Product and Topic Expert
0 Likes

I think the parameter you sent is having different type as can be accepted by data action. You need to convert it first.

You may check the example with section 5.35.3.1 of below help doc. 

https://d.dam.sap.com/a/3Y16uka/DeveloperHandbookSACAnalyticsDesigner.pdf