12-18-2023 01:45 PM
Hello all,
I created a triggered task, and the system triggering the task sends a couple of query parameters that I need to use for the task.
Can someone tell me how I can get the values passed as query strings when the task was triggered by the URL?
Thanks a lot in advance!
JF
Solved! Go to Solution.
12-19-2023 01:28 AM - edited 12-19-2023 02:16 AM
1) You can define the parameters(the ones that are expected to be sent by the system) in the pipeline properties, and access the parameters with "_" and the name of the parameter. ex: _param1.
2) You can access all the parameters with the QUERY_STRING argument.
ex: _QUERY_STRING
The result is string containing all the parameters sent by the system. ex: "test=value&test1=value1".
So, probably you will need to utilize some of the string functions in order to get/extract the parameters.
12-20-2023 04:06 AM
Hello @SpiroTaleski,
The "additionalData" is not sent as query parameter, and I can't seem to capture it as payload with the mapper.
This is what my mapper looks like, and I'm still getting the same error message:
I also tried to use simply "$" instead of "$additionalData" in the Expression field, but same error message...
I used the "webhook.site" website utility to capture the full data, and the "additionalData" field was displayed in the "Form values" section (sorry about the blurred sections, I have to anonymize before posting...):
Thanks,
JF
12-20-2023 04:15 AM
As I can see from the first screenshot, seems to fails on JSON Parser Snap. So, it looks like that the message being sent from the system is not valid JSON.
12-20-2023 08:38 AM
Hello @SpiroTaleski,
Indeed, the JSON doesn't make it to the mapper, so the issue seems to be with that input...
I have taken the value that webhook.site returned for that field and validated it, it is valid JSON apparently...
I tried to check the "Non-standard JSON" option in the JSON parser snap, but there's no change, I'm still getting the error.
Any idea?
Thanks!
JF
12-20-2023 12:17 PM
Hello again @SpiroTaleski,
I think that I'm getting somewhere, however it's still not working.
To fix the issue with the invalid JSON, I started the pipeline with a "Document to Binary" snap, and I'm not getting the error anymore!
What happens however is strange... The File Writer snap creates the files with the content I'm looking for, and now I realize why it's not valid JSON, it's because somehow all the double quote characters ( " ) have been escaped by a backslash ( \" ) making the JSON not valid. Like this:
The other strange thing is that I'm not getting the values from the query string anymore... Actually I do, and found the data by accident, when I tried to use the option "Write header file" in the "File Writer" snap. There was an extra file with the extension ".header" created, and it contained the query string that I couldn't find:
I need to use that information from the header file (query string), but I don't know where to find it in the snap variables...
Any idea?
Thanks a lot in advance!
JF
12-21-2023 01:13 AM - edited 12-21-2023 01:14 AM
Try first to store the data being sent from the system in a file on SLDB.
Put only File writer Snap with open input view, and store the data as JSON.
Then you can analyze the validity of the the JSON.