Issue with Invoke Code

Hi @Allan_Zimmermann,

I am working on a project where I need to extract all the data from a website and convert it into JSON format. Currently, I am integrating the project with a State Machine.

I am getting the input from OpenFlow, where I have stored all the required details in TransactionDT—from the Get Transaction state.

However, I am encountering an issue while processing the invoke code with Python:

TableCountXpath = f"//div[@id=‘app’]/div/main/div[2]/div[3]/div/div[2]/div/div/div/div[1]/div[{TableCount}]/div/table"

The TableCountXpath variable is passed into the Get Table Data activity to retrieve the table below:

image.

I am able to retrieve the data and convert it to JSON using the following Python code:

However, after both invoke codes are executed, the TransactionDT DataTable becomes empty, resulting in a null error: Object reference not set to an instance of an object. I have also tested both invoke codes individually, and I get the same error each time.

I’m not sure why the Transaction DataTable becomes empty. Could you please help me with this issue?

Thanks,
Ashok S

Did you map the variables for the python script? Im pretty sure python will not support that

Hi @Allan_Zimmermann ,

Thanks for your response.

I am able to print the output in the invoke code using Python:

[
{
“Freight Charges”: “Ocean Freight”,
“Curr.”: “USD”,
“20STD”: 3671,
“40STD”: 4792,
“40HC”: 4792
}
].

I have double-checked, and it appears that after executing the XPath, the TransactionDT DataTable becomes null, even though the XPath invoke code activity is not related to the DataTable."

TableCountXpath = f"//div[@id=‘app’]/div/main/div[2]/div[3]/div/div[2]/div/div/div/div[1]/div[{TableCount}]/div/table"

Thanks,
Ashok S

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.