1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "beforeCsv": `Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId
12OPP_A,2026-11-15,false,Proposal,5000.00,USD,USER_A
13OPP_B,2026-11-20,false,Negotiation,2000.00,EUR,USER_B
14OPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C
15OPP_D,2026-11-25,false,Proposal,1000.00,USD,USER_D
16OPP_F,2026-12-05,false,Prospecting,150.00,USD,USER_F`,
17 "afterCsv": `Id,CloseDate,IsClosed,StageName,Amount,CurrencyIsoCode,OwnerId
18OPP_A,2026-12-15,false,Proposal,5000.00,USD,USER_A
19OPP_B,2026-11-27,false,Negotiation,2200.00,EUR,USER_B2
20OPP_C,2026-12-10,false,Qualification,300.00,USD,USER_C
21OPP_D,2026-12-05,true,Closed Won,1000.00,USD,USER_D
22OPP_E,2026-12-20,false,Prospecting,800.00,USD,USER_E`,
23 "beforeAt": "2026-10-30T12:00:00Z",
24 "afterAt": "2026-11-06T12:00:00Z",
25 "minDaysPushed": 1,
26 "maxFindings": 25,
27 "maxRunSeconds": 120
28};
29
30
31const run = await client.actor("natstandridge/salesforce-close-date-slip-audit").call(input);
32
33
34console.log('Results from dataset');
35console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
36const { items } = await client.dataset(run.defaultDatasetId).listItems();
37items.forEach((item) => {
38 console.dir(item);
39});
40
41