โ08-04-2020 07:30 AM
Iโm basically doing what is described in the following article but am getting an error.
Failure: Service URL: $serviceUrl is undefined. Perhaps you meant: $requestBody, Reason: โserviceUrlโ was not found while evaluating the sub-expression โ$serviceUrlโ, Resolution: Check the spelling of the property or, if the property is optional, use the get() method (e.g. $.get(โserviceUrlโ))
This is from my REST Patch snap:
This is the json that is the input for the REST Patch snap:
[
{
โrequestBodyโ:
{
โExternalIdentifierNumberโ:
โ002500012โ
}
}
{
โserviceUrlโ:
"https:///โ
}
]
Thanks,
Scott
Solved! Go to Solution.
โ08-04-2020 08:25 AM
@swright your input JSON doesnโt look correct. If you want to reference two variables, they need to be within the same JSON object. For instance, this is an example of an input document to the REST PATCH Snap that would allow referencing $serviceUrl
and $requestBody
in the Snap settings:
[
{
"requestBody": {
"ExternalIdentifierNumber": "002500012"
},
"serviceUrl": "https://"
}
]
If you wanted two PATCH requests to be sent (sequentially, to different URLs etc), the input body would look like:
[{
"requestBody": {
"ExternalIdentifierNumber": "002500012"
},
"serviceUrl": "https://someurl.com"
},
{
"requestBody": {
"ExternalIdentifierNumber": "ABCD"
},
"serviceUrl": "https://anotherurl.com"
}]
โ08-04-2020 08:25 AM
@swright your input JSON doesnโt look correct. If you want to reference two variables, they need to be within the same JSON object. For instance, this is an example of an input document to the REST PATCH Snap that would allow referencing $serviceUrl
and $requestBody
in the Snap settings:
[
{
"requestBody": {
"ExternalIdentifierNumber": "002500012"
},
"serviceUrl": "https://"
}
]
If you wanted two PATCH requests to be sent (sequentially, to different URLs etc), the input body would look like:
[{
"requestBody": {
"ExternalIdentifierNumber": "002500012"
},
"serviceUrl": "https://someurl.com"
},
{
"requestBody": {
"ExternalIdentifierNumber": "ABCD"
},
"serviceUrl": "https://anotherurl.com"
}]
โ08-04-2020 09:16 AM
Hi Robin,
Iโm having some trouble getting it into that format. Iโm using a union and somehow that is the output of the union. The target path of mapper2 is the $requestBody.ExternalIdentifierNumber and mapper3 is the $serviceUrl.:
Thanks,
Scott
โ08-04-2020 01:30 PM
@swright A Union will combine two streams of documents into a single stream.
What you want to do is combine the actual document contents themselves (a document in one stream is combined with the content of a document in another stream). To do this, use the Join Snap where the left and right paths resolve to the same constant value e.g.
โ08-04-2020 04:23 PM
Thanks Robin! That corrected the error!
Scott