Search code examples
chainlink

Concatenate Task results within Job Definition?


Within Chainlink a Job definition, how would developers go about concatenating two results, like strings (Not the sum of values)? I provided an ideal approach below.

example1:

$(result1) + $(result2)

example2:

string_result_1      [type="jsonparse" path="$(decode_cbor.path_1)" data="$(fetch_encoded)"]
string_result_2      [type="jsonparse" path="$(decode_cbor.path_2)" data="$(fetch)"] 
encode_data          [type="ethabiencode" abi="(bytes32 requestId, bytes result)" data="{ \\"requestId\\": $(decode_log.requestId), \\"assetId\\": $(string_result_1) + $(string_result_2) }"]

I want to be able to make a new GET request by concatenating the two results.


Solution

  • You would need to do a multi-word response request, and then do the concatenation on-chain. The nodes do not support concatenation at the job definition level yet