I’m trying to copy from excel (CSV) to a website and the cell starts from A through E, to i (it depends). I have to copy and paste specific cells into a specific text area (this part I know how to do). I’m currently using click mouse functions to do this, but I want to do this without it. Please also note that my macro isn’t fully automatic, meaning I have to go to click next page and let it do the work and click next page.
I’ve been looking at different methods available here but I’m too noob to understand these concepts. Please help!
It doesn’t require to copy and paste these; this is a process of posting ads, so I’ll have to do them one by one (A through E). I’d eventually want to automate from 1-infinity
Edit: for now, just the address and units so far. I’ll be able to figure the rest (hopefully)
Here is a largely UN-TESTED Macro that should provide an example of how this might be done. You MUST make several changes BEFORE running this macro. See below.
MACRO: Use Excel to Fill Google (or Safari) Form Fields [Example]
This macro uses KM Actions Google Chrome Form Fields, but should work fine if you just replase the actions with the corresponding Safari Actions.
PART 1. COPY EXCEL AND PARSE TO KM VARIABLES
• I have tested this, but you should confirm
• Just select the Excel rows that contain "Address" and "Unit" columns
• Trigger this macro
• It will copy these cells, and parse into KM Variables:
• zumStreetNumber
• zumStreetName
• zumUnit
Select the Addresses to Process in Excel
and then trigger this macro
PART 2. SET THE CHROME WEB PAGE DOCUMENT FIELDS -- UNTESTED
• I have NOT test these actions because I don't have access to the web page
I have setup one KM Action "Set Chrome Field" for each form field on the page, with the proper KM Variable
You will need to CHANGE the "Set field" value to the proper web page forum field.
At the beginning of the process for each address, it will prompt you to confirm.
• At this time you can manually do what is necessary to bring up the form for the next entry.
First of all, I've been getting great helps from @JMichaelTX. I'm very new to programming and especially to KM and I wouldn't have gotten where I am without him.
I'm still baffled how to create new variables so I could put more data into it since this was only a portion. I've been noticing my data's columns are off so here's the updated real example: test.csv.zip (11.7 KB)
I'm sure I'm not the only one who's been having trouble with making excel to variables, so any information and insights will be very helpful!
Since you did not provide a detailed statement of what variables you want, and which form fields each variable should be set to, I can only offer you this:
The KM Variables are set to RegEx Capture Groups, in the order they are found in this pattern:
^([\w-]*)\s(\w.*).*\t(.*)$
Each Capture Group is denoted by a set of parenthesis "(" and ")"
The Capture Group returns the characters matched by the RegEx expression inside of the parenthesis.
To see how this works, and to modify or add more groups, goto http://regex101.com and enter the RegEx pattern, and a sample of the data you copy from Excel. Be sure to enter the "m" in the Options box to indicate multiple lines.
In the future, please provide an actual Excel file rather than a CSV file (which can introduce errors).
Thanks for tmy our input!
I’ve been trying to add the data for the description of the apartments (the long paragraph describes about the apartment), and I’ve been having trouble to put it into a variable (ex. Description). Do you have any clues how to add to variable that’s long string consists any alphabets, numbers?
Also, could you explain me how setting variables work? After this project, I’m planning to copy information on websites (html) to clipboard and set them as variable. I’ve been playing around with it but couldn’t find any “easy” ways to do this.
I have a similar, but a somewhat different situation. I have a list of names within a single column in Excel. The names are each in individual cells in the form "LNAME, FNAME". I'd like to transfer each consecutive name into an input field in another application.
In the other application, after copying the initial name into the text field, pressing a carriage return (Accept), it will create another input field beneath the first, with the original field scrolling up a bit to accommodate more entries.
In KM I have been able to copy the column of names into the Clipboard in a single list. I am not quite clear as to how to best transfer the names into the other application. Peter had mentioned in another post to assign variables to each of the names in the Clipboard, but I'm not sure how to do that.