Forum Discussion
Hi,
The provided information is not enough. could you execute the pipeline and share the detailed error log of the rest Get?
Also try and replace %20 with + as below and give it a try.
“INSTALLED_SW_LAST_CHANGE_TIMESTAMP+ge+”+Date.now().toLocaleDateString()+“T15:00:00-05:00)”
It didn’t work when filter is given in REST GET
But when I give in edit pipeline it works.
Here is the error log
REST API service endpoint returned error result: status code = 400
Resolution:
Please check the values of Snap properties.
Reason:
REST API service endpoint returned error result: status code = 400, reason phrase = Bad Request, refer to the error_entity field in the error view document for more details
Hide Details…
REST Get[592dae2559ee13133f007722_63f2942e-f7da-46bc-b36d-a5798debc42e – 059bb661-6992-47e5-9874-3d255a2be639]
`com.snaplogic.snap.api.SnapDataException: REST API service endpoint returned error result: status code = 400
at com.snaplogic.snap.api.rest.RestResponseProcessor.process(RestResponseProcessor.java:379)
at com.snaplogic.snap.api.rest.RestRequestExecutor.execute(RestRequestExecutor.java:426)
at com.snaplogic.snap.api.rest.RestRequestExecutor.executeOnce(RestRequestExecutor.java:323)
at com.snaplogic.snap.api.rest.RestRequestExecutor.execute(RestRequestExecutor.java:190)
at com.snaplogic.snap.api.rest.RestRequestExecutor.execute(RestRequestExecutor.java:173)
at com.snaplogic.snaps.rest.Get.process(Get.java:124)
at com.snaplogic.snap.api.ExecutionUtil.process(ExecutionUtil.java:106)
at com.snaplogic.snap.api.ExecutionUtil.execute(ExecutionUtil.java:70)
at com.snaplogic.snap.api.SimpleSnap.execute(SimpleSnap.java:70)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.executeSnap(SnapRunnableImpl.java:812)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.execute(SnapRunnableImpl.java:586)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.doRun(SnapRunnableImpl.java:877)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:436)
at com.snaplogic.cc.snap.common.SnapRunnableImpl.call(SnapRunnableImpl.java:120)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.base/java.util.concurrent.FutureTask.run(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Reason: REST API service endpoint returned error result: status code = 400, reason phrase = Bad Request,
refer to the error_entity field in the error view document for more details
Resolution: Please check the values of Snap properties.
Error Fingerprint[0] = efp:com.snaplogic.snap.api.rest.89xhsFt7`
The
jsonPath()
function can be used to read a value from an object at a given path ($col_name
is your path here). So, you should be able to use the following expression to do what you want:jsonPath($, _col1)
If you only have a property name and not a full path, you can use square-bracket notation to lookup the property. For example, if you set “col1” to “col_name” instead of “$col_name”, you can do:
$[_col1]
The language only sees “_col1” as a variable containing a string, which is why the output is the string “$col_name”. You need to use the jsonPath() function to interpret the string as a path.
Thanks a lot. it is working as expected. I have one more question.
There is an option of LEAVE BLANK TO DELETE SOURCE PATH under target path. How can I put a parameter there and pass blank so that the corresponding source column is not mapped in output.
check the 2nd and 3rd target path. I am passing blank in col2 parameter. so it is showing null instead of not showing that column in output. But If i leave that column blank as in target 3, it doesn’t show it in output preview. How can I achieve this?
Thanks in advance.
If “_col2” contains the name of the property you want to delete, you can use the following in the Expression column:
$[(_col2)]
When the “Target Path” column in the mapper is left blank, then the “Expression” column is treated as the JSON-Path to be deleted from the input document. So, if the property name to be deleted is not known ahead of time, you need to write the path to evaluate an expression to get the property name. That’s what this part of the path –
[(...)]
– is doing. The part between the parentheses is treated as an expression that should evaluate to the name of the property.