Gift split system ID via Power automate
I am creating a data warehouse in SQL to make it easier to analyse our giving and supporters.
I am struggling to extract the gift split system ID. I need this because we use split gifts- so if the gift changes I need to ref the split gift via the gift split system ID
It looks like in a lot of cases the gift split system ID is from a portion of the gift split import ID so this has helped
I can get it out with Power automate but it is only possible to get 5k lines out at a time- I am implemented a do until to loop through more than once so I can get 50000 at a time, but it normally stops once it reaches 10k lines- and I am not sure why.
It looks like I am allowed 200k calls in 24 hrs in PA, so I am not sure why, anyone have any ideas?
Comments
-

id field inside the gift_splits property is the gift split system record id
if you did not import gift into RE where you specified the gift split import id, then the gift split import id will always be the same format (00001-553-0000058274) with the gift split system record id at the suffix (i.e. 58274)
with SKY API for get gift list, you can only get 5000 gift records per call, so if you have more than 5000 gift records to get, you will need a do until.
I have 1.7M gift records that I sync using power automate, so yes, you can use do until for many more loops than you did, you need to change the do until limit, don't use Timeout but specify a Count that is enough to get all the records. (i use my limit count at 500, meaning 500x5000 = 2.5M gift records, when # of gifts exceed 2.5M, i'll increase this Count), unfortunately, this Count cannot use a variable, not allowed

SKY API limit is 25K API calls per 24hr period. NOT # of records returned per 24hr period.
My total # of gifts require a FULL gift load to loop 356 times, meaning making 356 api calls only.
0 -
@Alex Wong Alex thanks for your reply.
Oh this is amazing, so I was getting 1 gift at a time then looping through each split gift, (1hr to get 10k rows) but it looks like you are getting 5k rows a time, which looks to be 5k times faster than my method.
My intention was to load to SQL using the CSV created, but it makes much more sense to load directly to SQL in 5k chunks.
Could you help me a bit further with how you have your raw table set up in SQL , I assume you set it up with these specs: API Reference - SKY API (blackbaud.com)
In addition, how are you writing the complex Gift List object(s) to SQL 5K rows at a time
0 -
@Ashley Gelderblom
I use OPENJSON and it takes few seconds to handle 5000 records at a time: https://learn.microsoft.com/en-us/sql/t-sql/functions/openjson-transact-sql?view=sql-server-ver16As for SQL table, I use 4 different tables for all the info that comes back from the list gift API endpoints: gift table (for all 1-to-1 relationship gift data), gift soft credit table (for all gift soft credit data since 1 gift can have 0, 1 or more gift soft credit), gift splits table (for all gift splits on campaign, fund, appeal, package, and split amount, since 1 gift can have 1 or more splits), and gift fundraisers table (for all gift fundraiser/solicitors, since 1 gift can have 0, 1, or more fundraisers/solicitors). Combine that with the RE database Schema documentation to know the data type used for the fields (as you cannot tell that info from the API endpoint).
Below is my table definition. Note that I do not define the fields being nullable or not, and I do not use foreign key as it makes managing bulk insert and update difficult.
CREATE TABLE prod_gift (
gift_id INT PRIMARY KEY,
gift_amount NUMERIC(11,2),
constit_recordid INT,
gift_date DATETIME,
batch_number VARCHAR(50),
gift_status VARCHAR(20),
is_anonymous VARCHAR(5),
constituency VARCHAR(100),
lookup_id VARCHAR(50),
balance NUMERIC(11,2),
payment_method VARCHAR(20),
gift_subtype VARCHAR(100),
gift_type VARCHAR(30),
receipt_amount NUMERIC(11,2),
gift_code VARCHAR(100),
date_added DATETIME,
date_modified DATETIME,
ack_date DATETIME,
ack_status VARCHAR(20),
letter VARCHAR(100),
post_date DATETIME,
post_status VARCHAR(10),
receipt_num INT,
receipt_status VARCHAR(20),
reference VARCHAR(255)
)CREATE TABLE prod_gift_soft (
id INT PRIMARY KEY,
amount NUMERIC(11,2),
constit_id INT,
gift_id INT
)CREATE TABLE prod_gift_splits (
id INT PRIMARY KEY,
gift_id INT,
amount NUMERIC(11,2),
appeal_id INT,
campaign_id INT,
fund_id INT,
package_id INT
)CREATE TABLE prod_gift_fundraiser (
id INT IDENTITY(1,1) PRIMARY KEY,
gift_id INT,
constituent_id INT,
amount NUMERIC(11,2)
)0 -
@Alex Wong
Oh thank youI have not yet been able to connect my PA to SQL, so this may become more obvious when I can connect them, but which action are you using in PA to insert into SQL -insert row V2?
Everything else make a lot of sense. I am going to need another table I think for linked gifts, but can get to that later.
Are you using any other software SQL side to create view and link data? I have started using dbt What is dbt? (getdbt.com)
0 -
@Ashley Gelderblom
INSERT action will insert ONE row at a time, not good.use Execute SQL action and INSERT statement directly:
INSERT INTO….
SELECT * FROM OPENJSON…If you want to create view, just do that directly with CREATE VIEW sql statement using SSMS
For data transformation and table relationship management, it is done in Power BI
0 -
@Alex Wong
oh perfect thanks, now just to connect sql to PA- thanks for all your help0 -
@Alex Wong
So it turns out my sql instance is on prem so I was unable to connect SQL to PA. I have however managed with Power automate to create a single json text file of all gifts (just short of 2mil rows), and then run openrowset on SQL to load the Json file directly into SQL. Hooray, Thanks Alex1
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 656 Blackbaud Grantmaking™
- 577 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 941 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
