I’m trying to create management workflow using the management REST API. My flow has in moment two HTTP request nodes that worked as expected but i have problem how to create json input to my third http request node 3 to make api request. This third requires HTTP request node 3 REST API request requires output data from first HTTP request node 1 or function node 1 and second HTTP request node 2.
My flow is following:
The second HTTP request node node 2 makes REST API request returns empty json valu [] if there is now match for {$json[“id”] . Example of HTTP request node node 2 output:
Is possible some how merge/combain these outputs to one json input to the third HTTP request node 3 This Combaining/merge must also eliminate these blank json values that came from HTTP request node 2 outputs.
Hey @alolauri , acutally, you can use the Function node in order to remove the empty arrays from your outputs and then use the Merge node (twice one to combine data of first HTTP request & function node, second for to combine data of the merge node and the second HTTP request). Ofcourse, you can choose the right merge style to meet your needs.
Many thanks for reply , here is my clarification for subject
This third http request node 3 input must be the pair of values [{{$json[“id”]}] and {{$json[“hash”]}} where the [{{$json[“id”]}] value input produces the in HTTP request node 2 output which has not empty output with {{$json[“hash”]}} value.
Perhaps I’m misunderstanding, but this sounds like something you can do quite simply with expressions. You can create an expression for the URL on your second HTTP request node by clicking on the ‘cog’ icon to the right of the field and choosing ‘add expression’
I’ve created a sample workflow that might be useful for you. In this workflow, I am using the Function nodes to generate dummy data. Make sure to update the code in these nodes. Since I don’t have access to the API, I am not able to execute the workflow. However, this workflow should give you a hint and help you
(You can copy the below code and paste it in your workflow editor!)
I got the errror in 404 in REST API request because i could not create correct pair of values with merge and function nodes for HTTP request input .
This third http request node 3 input must be the pair of values [{{$json[“id”]}] and {{$json[“hash”]}} where the [{{$json[“id”]}] value input produces the in HTTP request node 2 output which has not empty output with {{$json[“hash”]}} value.
My Function node 1 java script is following:
My Function node 1 output sample:
HTTP request1 node output and Function1 node input sample:
What is correct way to use function/merge nodes ( and expressions) to get correct merge output to generate correct pairs of json valuses to make corcest REST API request with HTTP request2 node.