opsCTRL
Evolving Operations
API Reports
Opportunity Reports
This report retrieves a list of all your entities opportunities.
Report Format
Http Request Format: POST
Report URL: https://191wsd17nc.execute-api.eu-west-1.amazonaws.com/production/report
Reports are returned in a JSON format.
Power Query Structure & Functions
Functions Used:
Table.FromList – PowerQuery M | Microsoft Docs (Used to convert JSON data into a table format)
Splitter functions – PowerQuery M | Microsoft Docs (Identifies data is not delimited by comma or other delimeter)
let
url = "https://191wsd17nc.execute-api.eu-west-1.amazonaws.com/production/report",
body = "{""reportName"":""opportunities"",
""reportParams"": {""groupIDs"": all}
}",
Parsed_JSON = Json.Document(body),
BuildQueryString = Uri.BuildQueryString(Parsed_JSON),
Source = Json.Document(Web.Contents(url,[
Headers = [#"Content-Type"="application/json", #"x-api-key"="<Your Entity API Key>"],
Content = Text.ToBinary(body) ] )),
data = Source[data],
#"Converted to Table" = Table.FromList(data, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
#"Select Columns" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"additional_info", "associatedAccounts", "close_date", "closed_status", "created", "currency", "discussions", "endUser1Region", "expected_close_date", "fiscalPeriod", "fiscalQuarter", "fiscalYear", "forecast", "grossMarginDecimal", "groupName", "id", "likely_value", "likelyValueCLF", "likelyValueCLP", "likelyValueCOP", "likelyValueUSD", "marginAmountCLF", "marginAmountCLP", "marginAmountCOP", "marginAmountUSD", "opportunitiesCRMURL", "ownerName", "poc", "productName", "projectLikelihoodGoPercentageDecimal", "proposals", "reps", "status", "title", "winGoProbabilityDecimal", "winLikelihoodGetPercentageDecimal"}, {"additional_info", "associatedAccounts", "close_date", "closed_status", "created", "currency", "discussions", "endUser1Region", "expected_close_date", "fiscalPeriod", "fiscalQuarter", "fiscalYear", "forecast", "grossMarginDecimal", "groupName", "id", "likely_value", "likelyValueCLF", "likelyValueCLP", "likelyValueCOP", "likelyValueUSD", "marginAmountCLF", "marginAmountCLP", "marginAmountCOP", "marginAmountUSD", "opportunitiesCRMURL", "ownerName", "poc", "productName", "projectLikelihoodGoPercentageDecimal", "proposals", "reps", "status", "title", "winGoProbabilityDecimal", "winLikelihoodGetPercentageDecimal"}),
#"Renamed Columns3" = Table.RenameColumns(#"Select Columns",{{"likely_value", "OppValue"}}),
#"Renamed Columns" = Table.RenameColumns(#"Renamed Columns3",{{"title", "Title"}, {"productName", "Product"}, {"currency", "Currency"}, {"expected_close_date", "Expected Close Date"}, {"close_date", "Actual Close Date"}, {"additional_info", "Additional Info"}, {"status", "Opportunity Status"}, {"closed_status", "Closed Status"}, {"created", "Created Date"}, {"ownerName", "Owner"}, {"forecast", "Forecast"}, {"groupName", "Group"}, {"endUser1Region", "Region"}, {"grossMarginDecimal", "GM %"}, {"projectLikelihoodGoPercentageDecimal", "Go %"}, {"winLikelihoodGetPercentageDecimal", "Get"}, {"winGoProbabilityDecimal", "Prob %"}, {"fiscalYear", "Estimated Close Date (FY)"}, {"fiscalQuarter", "Estimated Close Date (Q)"}, {"fiscalPeriod", "Estimated Close Date (FY Q)"}}),
#"Removed Columns" = Table.RemoveColumns(#"Renamed Columns",{"opportunitiesCRMURL"}),
#"Renamed Columns1" = Table.RenameColumns(#"Removed Columns",{{"likelyValueUSD", "Value $"}, {"marginAmountUSD", "Marg $"}, {"likelyValueCLF", "Value CLF"}, {"marginAmountCLF", "Margin CLF"}, {"likelyValueCLP", "Value CLP"}, {"marginAmountCLP", "Margin CLP"}, {"likelyValueCOP", "Value COP"}, {"marginAmountCOP", "Margin COP"}, {"id", "OppID"}}),
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns1",{{"Expected Close Date", type datetime}}),
#"Renamed Columns2" = Table.RenameColumns(#"Changed Type",{{"Expected Close Date", "Excpected Close Date"}, {"reps", "_RepList"}, {"proposals", "_ProposalList"}, {"associatedAccounts", "_AssociatedAccountsList"}, {"poc", "_POCList"}, {"discussions", "_DiscussionList"}, {"Region", "State"}, {"Get", "Get %"}, {"Estimated Close Date (FY Q)", "'Estimated Close Date (FY YQ)"}, {"Estimated Close Date (Q)", "Estimated Close Date (FY Q)"}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Renamed Columns2",{{"Margin CLP", Currency.Type}, {"Value COP", Currency.Type}, {"Margin COP", Currency.Type}, {"Value CLP", Currency.Type}, {"Margin CLF", Currency.Type}, {"Value CLF", Currency.Type},{"Marg $", Currency.Type}, {"Value $", Currency.Type}}),
#"Renamed Columns4" = Table.RenameColumns(#"Changed Type1",{{"Excpected Close Date", "Expected Close Date"}})
in
#"Renamed Columns4"
Parameters
Group IDs
body = "{""reportName"":""opportunities"", ""reportParams"": {""groupIDs"": [specific group IDs you'd like to return]} }",
Available Fields
Name | Example Value | Data Type | Options / Notes |
additional_info | QAAuto_Description | Text | |
associatedAccounts | [List] | JSON Array | |
attributes | [List] | JSON Array | |
close_date | Time / Date | ||
closed_status | Open | Text | |
created | 2021-03-08T12:48:37.000Z | Time / Date | |
created_by | #U#1 | Text | If the ID has a “U”, it indicates an internal Supplier User followed by their ID. If it has a “C” in indicates a Contact followed by the ID of the contact. |
currency | USD | Text | |
currencyID | 36 | Integer | |
discussions | [List] | JSON Array | |
endUser1Region | |||
expected_close_date | 2019-07-30T00:00:00.000Z | Time / Date | |
expectedQuarterClose | 2 | ||
fiscalPeriod | 2020 Q2 | ||
fiscalQuarter | 2 | ||
fiscalYear | 2020 | ||
forecast | Excluded | Dropdown | Excluded, Included, Upside |
gross_margin | 10 | Number | |
grossMarginDecimal | 0.1 | Number | |
groupName | CRMThreeOQAAutoDENGroupName | Text | |
id | 1 | Integer | |
likely_currency_id | 36 | Integer | |
likely_value | 100 | Number | |
likelyValueAED | 367.24931 | Number | |
likelyValueAUD | 134.4986201 | Number | |
likelyValueBRL | 495.8601656 | Number | |
likelyValueCAD | 126.4949402 | Number | |
likelyValueCHF | 93.37626495 | Number | |
likelyValueCLP | 90793.92824 | Number | |
likelyValueCNY | 636.8905244 | Number | |
likelyValueEUR | 91.99632015 | Number | |
likelyValueGBP | 76.81692732 | Number | |
likelyValueGEL | 275.0689972 | Number | |
likelyValueHKD | 783.5326587 | Number | |
likelyValueILS | 322.3551058 | Number | |
likelyValueINR | 7605.887764 | Number | |
likelyValueJPY | 12556.94572 | Number | |
likelyValueMAD | 381180.3128 | Number | |
likelyValueMXN | 1988.50046 | Number | |
likelyValueMYR | 423.1830727 | Number | |
likelyValueQA test Currency | 919.9632015 | Number | |
likelyValueSEK | 950.9659614 | Number | |
likelyValueSGD | 130.6347746 | Number | |
likelyValueTHB | 3364.397424 | Number | |
likelyValueUSD | 100 | Number | |
marginAmount | 10 | Number | |
marginAmountAED | 36.724931 | Number | |
marginAmountAUD | 13.44986201 | Number | |
marginAmountBRL | 49.58601656 | Number | |
marginAmountCAD | 12.64949402 | Number | |
marginAmountCHF | 9.337626495 | Number | |
marginAmountCLP | 9079.392824 | Number | |
marginAmountCNY | 63.68905244 | Number | |
marginAmountEUR | 9.199632015 | Number | |
marginAmountGBP | 7.681692732 | Number | |
marginAmountGEL | 27.50689972 | Number | |
marginAmountHKD | 78.35326587 | Number | |
marginAmountILS | 32.23551058 | Number | |
marginAmountINR | 760.5887764 | Number | |
marginAmountJPY | 1255.694572 | Number | |
marginAmountMAD | 38118.03128 | Number | |
marginAmountMXN | 198.850046 | Number | |
marginAmountMYR | 42.31830727 | Number | |
marginAmountQA test Currency | 91.99632015 | Number | |
marginAmountSEK | 95.09659614 | Number | |
marginAmountSGD | 13.06347746 | Number | |
marginAmountTHB | 336.4397424 | Number | |
marginAmountUSD | 10 | Number | |
modified | 2021-03-08T12:48:37.000Z | Time / Date | |
name | Admin | ||
opportunitiesCRMURL | https://www.ovivo.co/admin/opportunities/view/1 | ||
opportunityProducts | [List] | JSON Array | |
ownerName | QA User | Text | |
poc | [List] | JSON Array | |
productName | |||
project_likelihood_go_id | 0 | Integer | |
project_likelihood_go_percentage | |||
projectLikelihoodGoPercentageDecimal | 0 | ||
proposals | [List] | JSON Array | |
rep1_accountName | CRMThreeOQAAutoDENAccountName | Text | |
rep1_name | CRMThreeOQAAutoDENContactName | Text | |
reps | [List] | JSON Array | |
status | Deleted | Text | Deleted, Active |
title | CRMThreeOQAAutoDENOpportunityName | Text | |
updateFromRep | 2021-03-08T12:48:37.000Z | Time / Date | |
win_likelihood_get_id | 0 | ||
win_likelihood_get_percentage | |||
winGoProbability | |||
winGoProbabilityDecimal | 0 | ||
winLikelihoodGetPercentageDecimal | 0 |
opsCTRL is proudly powered by WordPress