Micro Focus QTP (UFT) Forums
updating value in data table - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Others (https://www.learnqtp.com/forums/Forum-UFT-QTP-Others)
+--- Thread: updating value in data table (/Thread-updating-value-in-data-table)



updating value in data table - vls_1210 - 10-01-2009

Hi,

How do i update the value in the datatable with the previous value

Ex: if i have "abc" in "String" column and i want to update it with "efg", so the final value in the column should be "abcefg"

Thanks in advance


RE: updating value in data table - Saket - 10-01-2009

Store the Current value of datatable column in a variable
Concatenate it with the new string you want and assign again the new value to datatable column.

e.g
Code:
PrevValue = Datatable("String",dtlocalsheet)
ToAdd = "efg"
NewValue = PrevValue & ToAdd

Datatable("String",dtlocalsheet) = NewValue
is this what you are looking for?


RE: updating value in data table - basanth27 - 10-01-2009

Saket,
I might be wrong, but i guess your solution will update the existing value. if they are coming up dynamically i guess the original poster is looking for concatation.

@vls_1210 - Is the column string Value static ?? What i mean is if it is static then we can retireve add it with the dynamic value and then write it back in the cell.


RE: updating value in data table - vls_1210 - 10-01-2009

Thanks Saket


RE: updating value in data table - Saket - 10-02-2009

No Basanth, It will concatenate with the earlier value in table. doesnt matter whether it comes dynamically or is static. it will work and will depend on the way you have implemented the logic.

hope I am able to make it clear. let me know if there is any issue.


RE: updating value in data table - basanth27 - 10-04-2009

Sorry saket, My bad. Thanks for the clarification.