3 Replies Latest reply on Aug 29, 2011 9:06 AM by philmodjunk

    Import from XLS into a Portal

    Mitch

      Title

      Import from XLS into a Portal

      Post

      Hi,

      Is the any way to import from a Excel Spreed Sheet into the Portal Record. One Excel Record (line) per Portal Record...?

      Mitch

        • 1. Re: Import from XLS into a Portal
          philmodjunk

          Yes, but you need to import from a layout based on the portal's table rather than the field where you have the portal. This can be scripted so that it appears to the user that your imported records were imported directly into the portal.

          • 2. Re: Import from XLS into a Portal
            Mitch

            Ok, the script from the Main Layout which has the Portal embedded:

             

            - Freeze Screen

            - Go to Layout ["Portal"(Portal)]

            - Import Records

            - Go to Layout ["Main Layout"(Main Layout)]

             

            Could it be this simple?  Would you have to set a variable for the Main Layout ID and then a Loop after the Import to set the Portal ID the same...?

             

            - Freeze Screen

            - Set Variable [$ID; Value: Main Layout::Main Layout ID]

            - Go to Layout ["Portal"(Portal)]

            - Import Records

            - Go to Layout ["Main Layout"(Main Layout)]

            - Loop

            - Set Field [Portal::Portal ID; $ID]

            - Go to Record [Next; Exit after Last]

            - End Loop

             

             

            Mitch

            • 3. Re: Import from XLS into a Portal
              philmodjunk

              The second script is what I had in mind (But you need to assign the ID's to the newly imported records before changinb back to the original layout), but can be made a touch simpler:

              Freeze Window

              Set Variable [$ID; Value: Main Layout::Main Layout ID]

              Go to Layout ["Portal"(Portal)]

              Import Records

              Replace Filed Contents [no dialog ; Portal::PortalID ; $ID]

              Go to Layout ["Main Layout"(Main Layout)]

               

              Import Records produces a new found set of just the imported records. Replace Field Contents modifies every record in the current found set, so using these two steps together like this eliminates the need for a loop here.