I used two controllers to write the two functions and used two different variable names to pass the data to the view. Here is my controller 1 enter image description here