I am trying to update a tuple in my array in solidity. I currently have an array that looks like this Array[(a,b),(x,y)]. What i would like to do is to later be able to update it to look like so Array[(a,b,c),(x,y,z)]. Is this possible?

  • Can you show the solidity code? When you say later update you mean a contract upgrade or something else?
    – Ismael
    Commented Mar 24, 2021 at 23:40
  • This is what I am working on: mapping(uint => CLB) public CLBs; function addCLB(string memory _ACReg, uint _flightNo, uint _date, string memory _report, uint _IdNo) public { incrementPageNo(); CLBs[pageNo] = CLB(0, _ACReg, _flightNo, _day, _month, _year, _report, _IdNo, "", 0, 0); } function updateCLB(uint _pageNo, uint _date, uint _IdNo, uint _partNo, uint _serialNo, string memory _action) public{ incrementPageNo(); CLBs[pageNo] = CLBs[pageNo] + CLB(NEW); } I realize add them with the plus sign, it is just to show what i am trying to do. Commented Mar 26, 2021 at 8:00
  • Great! You can add your solution as an answer.
    – Ismael
    Commented Mar 26, 2021 at 18:20

1 Answer 1


You can do it like so: CLBs[_pageNo].reportDate = _reportDate;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.