Filling in a Non-Form Web Form

Hi Folks,

I'm new here and sort of new to KM. I'm going to give some background info on my use case, then the problem I'm having, and what I'm trying to do to fix it.

Background Info:

I have to import a file multiple times per day to update client data in our CRM. Basically the estimator takes measurements and generates an excel file (well, numbers, actually) in the field on an iPad. That file generates a bunch of numerical values that get used by the CRM to generate pricing for different services. So when a new lead comes into the CRM—after the estimator is done—I have to export the last sheet of this file to a one-line excel file (CRM does not import CSV files). This file is formatted so that all of the field names match up to what's in the CRM.

The Problem:
The CRM does not do any kind of automatic field mapping. This means for every file I import, I have to map each field each time. It also does not support "saved" field maps that I can create once and then re-use. This leads to major issues if I accidentally map the wrong field over, as the subsequent pricing that gets generated is way off.

How I'm trying to work around it:
I'm trying to create a macro that will automatically select the correct field mapping for me.

Some Details:

  • The import web interface is behind a login screen, so no point in sharing the URL. I can however copy the relevant section of source code.
  • The field mapping is done via dropdown menus, however based on my analysis of the source code (I'm no expert) they don't appear to be form/input fields. They look like SPAN elements wrapped in other code to make them appear to be dropdown menus.

So here is what the page looks like when I load the file:

And here is what I want it to look like: (note: there are about 30 fields, only a handful fit on the screen):

And here is a file containing the relevant section of HTML Source code. I can provide the entire source if needed.

SA Client Import Screen.html.zip (5.1 KB)

Lastly, here is my feeble and pathetic attempt at a macro :blush:

Image 1-19-21 at 1.49 PM
SA Client Import Field Map.kmmacros (2.0 KB)

EDIT: Thought it may be helpful to show what these dropdowns look like. They have a search field at the top to filter results.

Screen Shot 2021-01-19 at 1.53.23 PM

EDIT 2: Here is a copy of the excel file, in case anybody wants that. Just has the field names and 1 row of test data in it.

SA Input-SA Input Sheet.xlsx.zip (8.5 KB)

Hopefully bumping is okay to do around here—if not feel free to delete this reply, but does anybody have any insight into this?

Hey Hal,

Sure – so long as it's not every 5 minutes...  :sunglasses:

I took a quick look at the HTML you uploaded, and it's just dead when loaded up in Google Chrome.

As a non-form element you'll have to identify the field in question similarly to what you've done with document.querySelector('<code>') above.

document.querySelector('<code>').value = 'your entry text'

That's not very helpful, I know – but it's the best I can do without looking at the live page.

-Chris

Thanks for the reply. I didn't realize the way that HTML file was rendering. My apologies. I've got another idea for doing this, Would it be possible to open my file in numbers, load the correct cells into an array, then load them into the corresponding input fields on the CRM? The fields in the CRM are in fact "input" fields so I can select them, however they have no ID and are not uniquely named so I'm not sure how to properly select them in KM. I've attached a snipped of HTML that shows how the forms show in the CRM. Any help appreciated. Thank you!

webform.html.zip (2.4 KB)