Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Salesforce Batch Update

adutt1
6 - Meteoroid

Hello Everyone,

 

I am pretty new to creating macros on Alteryx and running a dynamic workflow. I am trying to figure out a way on my workflow to take inputs from a salesforce object to get my product id. Then using an excel file, I have to append the latest product value to the Ids.

 

Once that is done, I need to update the salesforce product value field with the excel values using product id. 

 

I know how to do that over other salesforce output tools but when it comes to alteryx, it becomes tricky as the batch sizes are too big for the update to happen. I tried exploring batch macro option to achieve this goal but I am not sure how to implement that in my situation. If someone can guide me to a better option that would be really helpful.

 

Thanks,

Anirudh

2 REPLIES 2
danilang
19 - Altair
19 - Altair

Hi @adutt1 

 

Here's an example of how you'd use a batch macro to create batches of records.   

 

 

MainMain

 

Determine the batch size you need and add this as a text input. Then add a RecordID to your data.  This will be used to break the input into batches.  Count the number of records in your input, append it to the batch size and use this to generate a row for each batch.  Connect this to the Control input of the batch macro.  The macro will loop once for every record included in the control input.  Connect the data rows to data input of the macro.

 

The Macro itself is set up like this

danilang_1-1616245619239.png

 

The data rows come into the input of the macro.  Connected to this is a filter with the following formula

 

RecordID >= (1 + [Engine.IterationNumber]*00) and 
RecordID <= (00+ [Engine.IterationNumber]*00)

IterationNumber starts at 0 and increases by 1 every time the macro loops.  All the "00"s are the strings that will be replaced by the value passed in to the control parameter.  This value is the batchsize=10 in this example, so for loop 0, the range is 1 +0*10 to 10 +0*10, or 1-10.  On the second loop, IterationNumber is 1 so the range becomes  1+1*10 to 10+1*10 or 11-20,  Third loop is 1+2*10 to

10+2*10 or 21-30, etc.

 

The batch id is added just to illustrate the concept and can be removed.  The Browse is there as a place holder.  Replace this with your SalesForce Output tool after cleaning out the recordId and batchid fields.  When each loop is complete, your sales force connection should be closed, so the overall effect is to pass your records in chunks determined by batch size

 

When you run the sample you see that the 1st 10 records are processed in batch 0, the next ten in batch 1, etc

 

danilang_2-1616246776487.png

 

Dan

 

 

PAY-TV-BASEBALL
5 - Atom

@danilang After upgrading to 2022.1, it looks like this Macro is no longer able to perform as an Iterative Macro Workflow Type...the option is no longer there due to the Control Parameter tool in the flow.

 

Is there an update to this Macro that could be done to still control the size of the Salesforce Output batch size?

 

 

2022-06-15_16-21-20.png

Labels