From Excel to a web page - user creation

Hi
I’m new to RPA Express - but I from the tutorials I cannot figure out how to export data from 3 columns in Excel to a web page, where I need to create users one by one. My first attempts pasted the combined contents of the columns into the new user field, instead of taking one row at a time. Now it doesn’t even do that. So I’m thinking something is wrong with how I create the lists or paste the values! - code below

import com.workfusion.studio.rpa.recorder.api.*
import com.workfusion.studio.rpa.recorder.api.types.*
import com.workfusion.studio.rpa.recorder.api.custom.*
import com.workfusion.studio.rpa.recorder.api.internal.representation.*

import com.workfusion.bot.exception.*

        
            def code = RList.of()
            
        
            def mail = RList.of()
            
        
            def userid = RList.of()
            

com.workfusion.rpa.helpers.RPA.metaClass.static.$ = { Closure c -> c.call() } // Support for Expression action. Should be implemented in RPA class in next release.

enableTypeOnScreen()


openExcel("C:\\Users\\sba\\K2 Management A S\\IT - Team Documents\\General\\IT Projects\\PrinterUserID_test.xlsx")

    try {
            
        userid = RList.of(getColumn("C:\\Users\\sba\\K2 Management A S\\IT - Team Documents\\General\\IT Projects\\PrinterUserID_test.xlsx", ExcelColumnRowPosition.FIRST))

            
        code = RList.of(getColumn("C:\\Users\\sba\\K2 Management A S\\IT - Team Documents\\General\\IT Projects\\PrinterUserID_test.xlsx", ExcelColumnRowPosition.NEXT))

            
        mail = RList.of(getColumn("C:\\Users\\sba\\K2 Management A S\\IT - Team Documents\\General\\IT Projects\\PrinterUserID_test.xlsx", ExcelColumnRowPosition.NEXT))


    } finally {
closeExcel("C:\\Users\\sba\\K2 Management A S\\IT - Team Documents\\General\\IT Projects\\PrinterUserID_test.xlsx")
    }



        switchToExistingWindow(new WindowDescriptor("Windows.UI.Core.CoreWindow", "Microsoft Edge", false, false).toString(), 10000)


    userid.each( {initials ->
        
            setClipboardText(initials as String)

        
    sleep(3000)
        inDesktop {
                $("[CLASS:Edit; NAME:AA_USR_UNnew]").click()
        }

        
inDesktop {
        sendKeys(StringTransformations.getHotKeyText(118, 2))
}

        
            setClipboardText(StringRepresentations.listToString(code, "", "") as String)

        
        inDesktop {
                $("[CLASS:Edit; NAME:AA_USR_UPnew]").click()
        }

        
inDesktop {
        sendKeys(StringTransformations.getHotKeyText(118, 2))
}

        
        inDesktop {
                $("[CLASS:Edit; NAME:AA_USR_UPnewTRY]").click()
        }

        
inDesktop {
        sendKeys(StringTransformations.getHotKeyText(118, 2))
}

        
        inDesktop {
                $("[CLASS:Button; NAME:AA_USR_Applynew]").click()
        }

        
    sleep(5000)
        inDesktop {
                $("[CLASS:Button; NAME:btnOption2]").click()
        }

    }) 

Basically I’m trying to get data from 3 columns in Excel - into 3 fields on a web page. But as the For Each loop only manages the index of the first list, then I get all the items from the 2nd and 3rd list on each loop :frowning:
Now tried to add all the values into one list, but how do I then split them when pasting into the webpage?

Hi @sbay you can read all three columns into a table using Get Range, and then use For Each loop to iterate through rows.
Here are the links to the Knowledge Base describing how to use these actions

https://kb.workfusion.com/display/RPAe/Excel#Excel-GetRange

https://kb.workfusion.com/display/RPAe/Loops#Loops-ForEach