Hi @tomka50501 I hope you are doing well.
Here below you will find the snipped code that hopefully will help you with the process that you want to automate.
When it comes to a For Each action, the output would be CurrenItem, however this Current item will contain all the information from the first row, then second row and so on.
So to get the First Name you don’t have to use %CurrentItem[First Name]%, you have to use %CurrentItem[0]%
Why Zero? Because zero is the first number from left to right, the assigned value to Zero is the First Name.
See the image below as well for reference.
Here is the snipped code:
SET ExcelFile TO $'''D:\\User\\wsanchez\\Course RPA\\First Item in For Each Loop\\TestData.xlsx'''
SET Website TO $'''http://enterhungary.gov.hu/eh/register'''
Excel.LaunchExcel.LaunchAndOpenUnderExistingProcess Path: ExcelFile Visible: True ReadOnly: False Instance=> ExcelInstance
Excel.ReadFromExcel.ReadCells Instance: ExcelInstance StartColumn: $'''A''' StartRow: 1 EndColumn: $'''E''' EndRow: 3 ReadAsText: False FirstLineIsHeader: True RangeValue=> ExcelData
Excel.CloseExcel.Close Instance: ExcelInstance
LOOP FOREACH CurrentItem IN ExcelData
Display.ShowMessageDialog.ShowMessage Message: $'''First Name: %CurrentItem[0]%
Last Name: %CurrentItem[1]%
Phone: %CurrentItem[2]%
Birtdate: %CurrentItem[3]%
Email: %CurrentItem[4]%''' Icon: Display.Icon.None Buttons: Display.Buttons.OK DefaultButton: Display.DefaultButton.Button1 IsTopMost: True ButtonPressed=> ButtonPressed
END
Please let me know if it works, happy automation!,
If I have addressed your inquiry successfully, kindly consider marking my response as the preferred solution. If you found my assistance helpful, a 'Thumbs Up' would be greatly appreciated.
Additionally, I offer specialized consultancy and development services leveraging PAD. If you're interested in exploring these services further, feel free to DM me, and we can initiate a discussion.
Kind regards,
Will SG
Managing Director & Automation Lead
RAMS CR (Recruitment & Automation)
LinkedIn Profile
