Need help please, I’m working on project using DataTable, I need to store value from previous transaction to match with current value. (specific column value)) Thank you so much !
Just put the value into a variable
I did but it’s not holding until next transaction, or I can say it’s overriding with current.
Do One thing simple solution, add the value to the assert.
Create assert like TempValue so every time you can update the assert value.
for first run means in int state clear that temp assert in orchestator.
Step1: Create assert in orchestator.
Step2: when bot runs from Init state clear the assert every time.
Step3: what you want to add the value please use the activity called set assert.
Step4: read the value use get assert and match the current value.
so you won’t get confused.
Let Me know if you @sk.abdulrahim99 are facing any issue in this.
If it isn’t holding until next transaction then you have the variable scoped wrong. You need to scope it higher so it persists across transactions.
Thank you so much for helping on this one, but I think this will not work.
Data Table:
Customer ID | Customer Name | Order Amount | Order No | Number Of Products | Column1 |
---|---|---|---|---|---|
879456 | Rakesh Kumber | 12745 | 1 | sjlkfj | ljsl |
879457 | Nagesh Reddy | 8745 | 2 | kjslkf | ksjj |
879458 | James Harvey | 3582 | 3 | sjll | slj |
879459 | Ramesh Sharma | 8792 | 4 | skj | ljl |
Get Transaction will pass first row to Process state, so when first record processed in process state there we need to store cust id for first record then get transaction will pass second row to process state there we need to match cust id from first row to cust id which process state processed earlier.
Sorry for confusion … if this helps to answer
you can create a list and add to it
example: list_customerId is the list of string datatype
In this table what you are going to store and from which data you are comparing?
Whole row or one ID?
matching just cust id, but we need entire row to process state.
If cust id is same then we ignore cust id and process other fields in same row.
So In this case use any temp Excel sheet after comparing the row delete it OR create a queue and add the value to the Queue if the data is Match delete it.
Create Queue is the better option after every transaction add the value and delete it Like i said in the Assert the same step you can follow.
Hi SirJi… i have tried as you said, trying to match next row from datatable, but when it comes to last transaction and matching with next row(next row is blank no record now) it shows error in assign activity. I’m doing this in process transaction.
Assign: There is no row at position 4.
please advise how should i handle this. Thank you so much !
Hi @sk.abdulrahim99 , please create a copy data table2 from data table1 and compare the customer ids in table 2 using index of the table1