Please interpret the code - help me

Hello
I’m struggling to write this code and apply it while using the Extract Structured Data activity. Could you please help me with it? I really need assistance. Thank you.

Suppose for example declare an Integer variable for counter(counter), use second variable(rowSelector) which should be of string type to assign the selector as above, and set the variable rowSelector in place of the selector property

Initialize counter
Start loop
assign rowSelector
(This should update the rowSelector in each loop resulting in new selector for each new row found in PDF
image
)
Check if selector exists / present
Fetch value using the rowSelector if the selector exists
Increment loop
End loop

@22222222asas

For incrementing you can use index properly of loop directly which auto increments

For checking use check app state activity

Cheers

1 Like

Hello @22222222asas

Take Assign Activity
counter = 1

Do While ElementExists(rowSelector)
Assign rowSelector = “your_base_selector_here” + counter.ToString()

If ElementExists(rowSelector)
     Use Extract Structured Data activity with rowSelector
    
     Process extracted data
    
    Assign counter = counter + 1
Else
    Exit Do
End If

Loop

Thanks & Cheers!!!

1 Like

@Kartheek_Battu

I’m really sorry

Please provide screenshot with explanation for clearer understanding!

Thank you so much

@22222222asas

  1. Assign Activity:
  • Assign counter = 1.
  1. Do While Loop:
  • Use a Do While loop that checks if the element indicated by rowSelector exists.
  1. Inside the Loop:
  • Update rowSelector by appending counter.ToString() to the base selector.
  • If the element exists:
    • Use an Extract Structured Data activity with the updated rowSelector.
    • Process the extracted data.
    • Increment counter.
  1. After the Loop:
  • Use a Flow Decision activity to check if the element doesn’t exist.
    • If not, exit the loop.
    • If yes, loop back to the Do While activity.

Thanks!!!

1 Like

Thank you so much


Is it correct to write the code like this? If not, please feel free to provide feedback at any time!

1 Like

@22222222asas
yeah it is the correct way to write code like this

1 Like

I’m really sorry

assign
rowSelector = ?? What value should be stored?

“I’m unsure about the meaning of ‘your_base_selector_here’.”

plz help me…

@22222222asas

  • Replace “your_base_selector_here” with the specific selector that identifies the rows you want to process, based on your application’s structure.
  • The selector should contain attributes like tag names, classes, IDs, or other properties that can uniquely identify the rows.

For example, if your rows have a class name “data-row” and can be identified using a unique “data-id” attribute, the selector might look like this

“”