Skip to main content

MyApi call to an export with data

Comments

4 comments

  • Official comment
    Bhavik Shah Senior Product Manager
    Answer Pro
    Great Answer

    Thanks bill budwitz for reaching out. Glad to know that you were able to solve the issue by recreating the export as an object. About passing the extra data in Payload such as search criteria, we will consider this as an enhancement. We will keep you posted around this once this enhancement is available. 

  • bill budwitz
    Celigo University Level 1: Skilled
    Engaged

    I was able to solve by using export.runVirtual and getting the export document and recreating the export as an object. 

    it would still be interesting to know if using export.run to reference the export directly and pass in a payload/parameters for the search  criteria. 

    thanks

    0
  • Todd Hill

    I want to do the same thing.  I can get the data, but not being able to pass it through the export itself, I lost the array.  How did you do it?

    0
  • Scott Henderson CTO
    Answer Pro
    Top Contributor

    Todd, maybe this example here in the docs will help shed some light on how to do this. At a very high level, the 'export.runVirtual' function allows you to define the export configuration that you want to run in your code directly, and you can parameterize it however you like.

    For sure it is tedious to define the export objects in your code directly, because then you need to configure all the right fields that the UI does on your behalf already. The way I always do this is first create the export that I want to run in the UI, and then I use something like Postman to GET '/exports/_id' for the export that I created so I can see the JSON, and then i copy and paste the JSON for the export into my JavaScript code, and then simply change the parts that I want to be dynamic.

    We have plans for R1/R2 next year to make all of this much much easier where you can easily pass parameters to your existing exports in your JavaScript (i.e. without having to use virtual exports at all). I know this does not help you right now, but there is a better UX on the near term horizon.

     

    0

Please sign in to leave a comment.