I'm trying to figure out how to take the value from two different fields, perform calculations on them and then return the value of those calculations. I have a response that returns an array of fields. Two of the fields contain location cordinates (one field for lat, one field for long).
What I want is to pass both of these values to a single label element, run them through a function that gets a saved set of coordinates from local storage, and the returns the distance between the two sets. I have a working function to perform the calculations but I just can't figure out how to access the values when passing two fields to a page element. Any advice?