Dilemma on the best way to work with SF


Im starting a new project on Salesforce lightning with RPA.

basically I get an Excel file with Policies numbers and need to do some actions on the specific asset.
In my other projects I start with SOQL to get all my needed IDs, but now my starting point is external.

what do you think is the best way to get the asset ID for each policy number? I thought about running a single SOQL with policy number each time my Performer start with a new task. but I prefer a bulk option to do it all in once at the Dispatcher (Just for getting the Asset ID).

any suggestions?


Hi @liranl

You can do the same what you are doing at the performer start in the dispatcher and add them to the specific content of each item(You can add the corresponding ID only by filtering the policy id) you are adding so that when retrieved we can have the required ID as well. And yes moving it to dispatcher makes more sense as it is kind of an input for the subsequent process


so you mean stay with a SOQL of 1 result for each line of excel sheet?

Hi @liranl

You can do bulk get of SOQL in Dispatcher as well …as you know all the policy numbers already. Just use a filter for each add queue item to identify the required ID

If bulk is having limitations that is when we can go with one soql for each, because advantage of bulk is that we interact with external application only once.


maybe you have an example to use it in this way?

Hi @liranl

I dont have a xaml but i can give you more details in steps

  1. Read the policy id from excel
  2. String.join(β€œβ€˜,β€™β€œ,”Dt.select(function(c) c(β€œpolicy no”).tostring).ToArray) and this will give you a string of policy numbers concatenated with single quotes store it in a variable say str which is used in next step
  3. Fire a soql select policyno,ID from table where policyno IN (β€œβ€˜β€œ + str + β€œβ€˜β€œ) include any extra braces or inverted comma needed this will give you all id’s at once. my assumption is you are trying to get from the same object if objects are different then query changes accordingly
  4. Now pass the output datatable to the io_transactiondata and change your trans item to datarow and add both policy no and id to the queue

Rest follow the performer


first of all thank you for the detailed solution.
but I thought I have an option with Bulk API to do it and without any SOQL. meaning solution out of the box of Salesforce activity
so I think I will stay with a loop and single SOQL to each line in excel

1 Like