When sending parameters to a web server, how do you include piped text from an embedded data object? | XM Community
Skip to main content
Whenever I try to do this (my embedded data is, in this case, a JSON string), I get an error like `Unparsable argument: ${e://Field/jsonObj}`.
Hello @JoshuaLandman ,



We use it as shown below

`key : "${e://Field/jsonObj}"`
Hi @Shashi,



Thanks for your tip! I tried that, and instead of the previous error I mentioned, I got this one instead: `lexical error: invalid char in json text. ${e://Field/jsonObj} (right here) ------^`



Do you have any tips for getting past this one?
> @JoshuaLandman said:

> Hi @Shashi,

>

> Thanks for your tip! I tried that, and instead of the previous error I mentioned, I got this one instead: `lexical error: invalid char in json text. ${e://Field/jsonObj} (right here) ------^`

>

> Do you have any tips for getting past this one?



Can you please send the screen shot of web service element OR if you are using postman or some other application please send the json objects
!
> @JoshuaLandman said:

> !

>



May I know the api you are using?
On the client side, I'm using the standard Qualtrics web interface.



It's a custom, unreleased API on the server end. I'm not able to speak about it more at this point. I tested that string locally using that API and it works with the endpoint I'm sending my POST request to.
> @JoshuaLandman said:

> On the client side, I'm using the standard Qualtrics web interface.

>

> It's a custom, unreleased API on the server end. I'm not able to speak about it more at this point. I tested that string locally using that API and it works with the endpoint I'm sending my POST request to.



Try removing the quotes around the piped text and change JSON to String in the jsonObj row
I still get this error: `lexical error: invalid char in json text. ${e://Field/catObj} (right here) ------^`

I use string as a type for any embedded values to be passed and it works.
Can you mention what kind of data does your embedded variable hold which needs to be passed?


I’ve just been struggling with that as well. In all variants I tried (including the ones suggested above), my other backend (the recipient of the POST request) never received the actual value of an embedded data item, but the piped text such as ${...} instead - as if the piped text was never parsed/changed into the value it refers to.

The embedded data I wanted to sent to my other backend was the ResponseID. Accordingly, I had a block where this was set.

What worked in the end - which seems a bit random to me - was to NOT USE ResponseID, but to generate a (sufficiently large) integer value instead. In the web service block I then chose (application type/json of course) the type integer et voila: the piped text expression was parsed/changed into the value and thus received by my other backend.

Hope this is of help to anyone else struggling with something similar. Good luck.


@aldespin “...never received the actual value of an embedded data item, but the piped text such as ${...} instead - as if the piped text was never parsed/changed into the value it refers to.” Did this happen on a live survey or the test your were running in the survey flow?

 

Seeing all the posts above, the issue appears to be that you’re testing the API via the survey, which will fail because Qualtrics will send the string you’ve programmed. It is only when the survey environment is triggered (either via preview or the survey), that the values get mapped. 


Leave a Reply