Concatenate Task results within Job Definition?

Viewed 37

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.

2 Answers

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

Depending on your setup, you could also farm all that heavy lifting, i.e. the string concatenation and response prep to a Chainlink External Adapter.

Related