How to use the 'input' object as a whole

Options
Hi,

I am using Xano as a means of logging network activity when calling external APIs from my app, I would like to extensively log requests coming in and out for trail reasons. So, it sits almost like a piece of middleware in addition to functioning as a database. Is there any way to have access to the 'input' object (as appears below)?
[Screenshot 2021-07-01 at 12.13.17.png]
In fact, being able to just have the env object would be super useful too as opposed to having to explicitly state which part of it are needed. 

I can see that the data coming in is exactly how I need to record it, and my current flow is as follows:
- Data comes in.
- Create a new object (outgoing_request) to store all the request data.
- Add a new property onto the object (ie. outgoing_request.headers) to store $http_headers.
- Add a new property onto the object (ie. outgoing_request.input) and store the input data in there. 

Generating a new discrete property on the object for every input is not an option as it is far too labour intensive, however it is currently the only path I can see.

Please let me know if anything is unclear.
Thanks!

Comments

  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Yes, you can certainly grab the whole object and use the merge filter to add it to an existing one. Here's a quick tutorial I made:

    
    Let me know if there's anything else that's unclear or you don't have an answer to
  • Kiran Marshall
    Options
    Thanks for this, but I'm still unsure of how to grab the whole 'input' object that appears during the fist step in the debugger (under the heading Environment, before any function stacks are called). It's got all the information I want to add to the 'outgoing_request' object I've created to hold the information. 
    The only reason I was able to grab the headers is because they appear as a variable under env in the UI. Is there some way to get hold of 'input' as self contained variable like this?
  • Michael Udinski
    Michael Udinski Administrator

    ADMIN

    Options
    Ohhh i didn't realize you were looking at the debugger and not the response. There is a utility function called Get All Inputs which you can use to retrieve all the inputs and store it in a variable. 
  • Kiran Marshall
    Options
    Great, that was super helpful. Thanks.