• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

How to allow user to import CSV through button behavior?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to allow user to import CSV through button behavior?

    I have an app that is basically just a select * from the DB2 table, and displays in edit grid view. I wanted to add a button to prompt the user to browse for a file they have locally and then kick off the process to import that file into the table. I vaguely remember that it is done through a button behavior that calls a RPG script and that there was an example one provided. Could I get an example of how this is done?

  • #2
    Yes, just add a button to the application, then add a "Call RPG Program" action. Next, select the "Prompt User for More Information" section and add an upload field. Since you specified CSV, you can add a valid extension of csv. Below are a couple of images showing this.

    You will want to copy the template RPG program "EXNABBTN03," which will allow you to easily save the file on the IFS.

    Forum NAB RPG Call Action.png

    Forum NAB Prompt For More Info.png?

    Comment


    • #3
      We apparently have the file and that does prompt me to pick a file, but how do I set it to save to the file to a specific location? I am having trouble locating the file also on our IBMi so that I can read it and understand what it is doing exactly.

      Comment


      • #4
        You need to set the path 'vvIn.path?' in your RPG program that should be based on EXNABBTN03

        Comment

        Working...
        X