MyApi call to an export with data

Comments

6 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. 

  • Scott Henderson CTO
    Celigo University Level 1: Skilled
    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.

     

    1
  • 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
  • Nuri Ensing NetSuite Integration Whiz
    Celigo University Level 4: Legendary
    Awesome Follow-up
    Engaged

    Scott, I know this topic is 9 months old, but I wanted to thank you for your helpful answer. Your tip on using Postman to get the JSON for the export and then modifying it in my code was brilliant. It saved me a lot of time and hassle. I tried it and it worked like a charm! I’m excited for the new UX that will make this even easier. I really appreciate your time and expertise.

    0
  • Scott Henderson CTO
    Celigo University Level 1: Skilled
    Answer Pro
    Top Contributor

    Happy to help!

    0

Please sign in to leave a comment.