Scape and writing to a Global Variable (Array)

Alright freinds. I’ve got a fun one for us.

Let me tell you about my work flow to scrape information.

I ask the end user for an spreadhseet they want to work on. I bring that table into as a variable called selected_files (global variable).

First, I have a subprogram called MoveColumns. It copies and pastes a few columns. That works.

Second, I have a subprogram called WriteSpreadsheetColumns. This write Headers for Columns M to W.

Third, I have a Read Tables Block, this reads the selected_files variable, uses Table Headers as the Direcotry Key, and is Global. I named this variable imported_table.

Fourth, I begin my Do while Loop. i=0. If i < imported_table['Current Roster].length then …

Fifth, I create a (global) variable id=imported_table[‘Current Roster’][i][‘Record Number’]. I have written this to the Console Log. This works!

Sixth, I created a variable (global) called row. row = i

Seventh, I have a subprogram called OpenRecord. I can open the record using the variable id.

Now for where my issue is, Eighth, I have a subprogram called Gather Data.
This subprogram branches into 3 subprograms.

  1. AuthScrape
  2. SScrape
  3. PScrape

I can see my Global Variables in the Subprogram.

Let’s focus on the AuthScrape. I am able to scrape the AuthorizationNumber, create a variable, and write the number to the Console Log. But I cant get it update in my variable imported_table. The Column in imported_table is Column M with the Header Authorization Number. I am using the Update Excel Block. Maybe I am using the wrong Block.

I feel like once I fix this issue, it will be the same fix for my other Subprograms in this branch.

I would love to hear your thougths. And thanks for any help in advance. Antonio.

@antoniofdelgado Could you please share .neek file here to check this
Based on the details provided, I can think of below (these are assumption based on the details you mentioned)

  1. Please validate row variable again such as its global,its with correct value(cell number)
  2. Try with Native(Interaction Method)
  3. make sure authorizationnumber is not blank
  4. Try with update excel Row activity(Just to narrow down the issue)

Let us know the outcome of all the above and share the neek file to check this further

Thanks for the response @Kudlappa_Gouder

NewMissionSearchPatientScrape.zip (1.6 MB)

Attached is the .neek project to play with.

  1. I ensure the row variable is global. This is true.

  2. I just changed the Interaction Method to Native and still have the same issue.

  3. I can confim that I got the correct AuthNumber in the Console Log. But it did not write to the Excel Sheet.

Attached is a Test Spreadsheet for you.
TestSpreadsheet.zip (8.4 KB)

Here is my error.

I need a second to try your step number 4. More in a bit. Thanks!

@antoniofdelgado I tried with simple example using same logic. The only change i can see is, You have made i=i+1 as local. Can you please make this i=i+1 also global and test again.