'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 1:[1]
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
Solution 2:[2]
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.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Harry Papacharissiou |
| Solution 2 | Ijonas Kisselbach |
