Pulling out data from multiple contract

You can lookup a contract on the ledger if you have its contract ID, or the contract has a key and you have that key, and you are a stakeholder in the contract.

However, most workflows that build up a final contract like your CombineDataSet are linear and cumulative, meaning they carry along the data from each preceding step, and each template has a choice that accepts additional data and takes you to the next step. The new Daml training videos feature several examples of this.

If that does not fit your use case, contract IDs may be passed as choice arguments; this is the easiest way for you to get at the contracts you want to combine, but it is worth asking yourself: what do you want to happen to the prior contracts then?

2 Likes