Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
updating value in data table
#1
Solved: 10 Years, 9 Months ago
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
Reply
#2
Solved: 10 Years, 9 Months ago
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?

Reply
#3
Solved: 10 Years, 9 Months ago
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.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply
#4
Solved: 10 Years, 9 Months ago
Thanks Saket
Reply
#5
Solved: 10 Years, 9 Months ago
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.

Reply
#6
Solved: 10 Years, 9 Months ago
Sorry saket, My bad. Thanks for the clarification.
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Missing Resources, Information Pane, Debug Viewer, Run time Data Table not visible Aurodeepta 3 6,769 05-28-2015, 02:52 PM
Last Post: Aurodeepta
  Data Table in QTP QTPBeginer 1 3,632 08-25-2013, 02:28 PM
Last Post: GregHicks
  how to move an array to data table jloyzaga 0 2,680 11-08-2011, 07:52 AM
Last Post: jloyzaga
  Using vlookup on data table Setsuna F. Seiei 0 3,286 08-19-2011, 06:43 AM
Last Post: Setsuna F. Seiei
  Accessing and Updating Input Excel from QC using QTP maheshvjwithqtp 0 2,602 12-02-2010, 09:42 AM
Last Post: maheshvjwithqtp

Forum Jump:


Users browsing this thread: 1 Guest(s)