Pass a JSON string/object as args to a sub routine
See original GitHub issueIs there any way to pass in a JSON string as an argument to a subroutine like this:
> + Do Something
> - <call>doSomething {action:"print", path:"/one/two"}</call>
>
I tried a few ways to parse the args as a JSON object and pass it onto another function but I have been unable to get a JSON object that mirrors the JSON string as passed to the subroutine from the rivescript. Is there another approach I can take to accomplish the same?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (5 by maintainers)
Top Results From Across the Web
How to pass json object as a parameter to another method
A JSON object is not more than a regular javascript object. It should work if you pass it as a parameter to a...
Read more >How to pass a json object as a parameter to a python function?
Practical Data Science using Python We have this code below which will the given json object as a parameter to a python function....
Read more >Passing JSON as parameters to JavaScript when there are ...
Passing JSON as parameters to JavaScript when there are nested objects. Good day. I'm trying to use FileMaker.PerformScript in a Web Viewer ...
Read more >JSON argument - SecondState.io
Use JSON strings as function arguments. ... Rust is able to map a JSON string to a Rust object using what is known...
Read more >Object functions for Bicep - Azure Resource Manager
If you need to include a parameter value or variable in the JSON object, use the concat function to create the string that...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@kirsle, I will be happy to help with the implementation of this new feature! We can further simplify the JSON schema where “object” key specifies the subroutine to be called and “params” contains an arbitrary key/value pairs as follows:
Please let me know your thoughts on how I can contribute.
Regarding the workaround, I am not sure if it can handle concurrency since the uservar (tmp) could change between multiple invocation of the same trigger by the same user and could potentially run into one invocation getting the args of another invocation, right?
I have been playing around and tried the following:
Here is one of the snippets I have tried.
This approach does not require a major change and continues to keep the
<call>
tag sane and simple! What do you think?