Modify the newly created transaction report
PUT {{baseUrl}}/api/model/transactionReports/:reportId
Update a transaction report's definition through Modeling service, based on the definition provided in request body. The definition of the modified transaction report will be returned in response and will be saved to metadata at the same time. The project ID is required to create a report in metadata. An authorization token is required to execute the request and can be obtained using Authentication endpoints.
Users are allowed to modify the following parts:
description
in theinformation
field;id
,name
,dataType
andrequired
ofcolumns
field. If you don't provide the ID, a new column will be created, and don't forget to delete the referenceobjectId
field of the attribute form or metric that is mapped to this column;- SQL tree in the
sqlExpression
field; id
,name
(ifid
is provided, name changing will not take effect),forms
and column reference of attributes.id
,name
(ifid
is provided, name changing will not take effect), and column reference of metrics.
Request Body
{"table"=>{"physicalTable"=>{"columns"=>[{"name"=>"Opportunity (ID)", "dataType"=>{"type"=>"integer", "precision"=>4, "scale"=>0}, "required"=>true}, {"name"=>"Competitor (ID)", "dataType"=>{"type"=>"fixed_length_string", "precision"=>255, "scale"=>0}, "required"=>false}, {"name"=>"Opportunity_Size", "dataType"=>{"type"=>"double", "precision"=>18, "scale"=>0}, "required"=>true}], "sqlExpression"=>{"tree"=>{"function"=>"concat_no_blank", "children"=>[{"function"=>"repeat", "functionProperties"=>[{"name"=>"Distinct", "value"=>{"type"=>"boolean", "value"=>"true"}}], "children"=>[{"type"=>"constant", "variant"=>{"type"=>"string", "value"=>" \r\n\r\nUPDATE F_SALES_OPPTY\r\nSET\r\n"}}, {"function"=>"apply_optional", "children"=>[{"type"=>"constant", "variant"=>{"type"=>"string", "value"=>"COMPETITOR = #1,"}}], "type"=>"operator"}, {"type"=>"constant", "variant"=>{"type"=>"string", "value"=>"\r\nOPPTY_SIZE = "}}, {"type"=>"constant", "variant"=>{"type"=>"string", "value"=>"#2"}}, {"type"=>"constant", "variant"=>{"type"=>"string", "value"=>"\nWHERE\r\nOPPTY_ID = "}}, {"type"=>"constant", "variant"=>{"type"=>"string", "value"=>"#0"}}, {"type"=>"constant", "variant"=>{"type"=>"string", "value"=>"\r\n\r\n"}}], "type"=>"operator"}], "type"=>"operator"}}}, "attributes"=>[{"name"=>"Opportunity", "forms"=>[{"id"=>"45C11FA478E745FEA08D781CEA190FE5", "category"=>"ID", "type"=>"system", "displayFormat"=>"number", "expression"=>{"tree"=>{"type"=>"column_reference", "name"=>"Opportunity (ID)"}}}]}, {"name"=>"Competitor", "forms"=>[{"id"=>"45C11FA478E745FEA08D781CEA190FE5", "name"=>"ID", "category"=>"ID", "type"=>"system", "displayFormat"=>"text", "expression"=>{"tree"=>{"type"=>"column_reference", "name"=>"Competitor (ID)"}}}]}], "metrics"=>[{"name"=>"Opportunity_Size", "dataType"=>{"type"=>"numeric", "precision"=>0, "scale"=>0}, "expression"=>{"tree"=>{"type"=>"column_reference", "name"=>"Opportunity_Size"}}}], "dataSource"=>{"objectId"=>"BCB3836D4C70EDF53CB706ABA556B44B", "subType"=>"db_role", "name"=>"Operational Datamart"}}}
HEADERS
Key | Datatype | Required | Description |
---|---|---|---|
X-MSTR-AuthToken | string | ||
X-MSTR-ProjectID | string |