Need a macro to compare two cells and perform actions

I use the webservice function to retrieve a json dataset and a recorded macro to update it on pressing a button.
Here’s the recorded macro that i use:

sub Update_Price
rem define variables
dim document   as object
dim dispatcher as object
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dispatcher.executeDispatch(document, ".uno:UpdateTableLinks", "", 0, Array())
end sub

I need to extend this macro so that after the new data is loaded it compares the content of the cell with the function to another cell, and only if they don’t match replaces the content in that other cell with the new data and updates the current date and time in the third cell.

I guess no one would be very keen to answer on such early premise.
hint : why not match & update your cells with plain formulas ?

I know i can use exact to compare the cells, i don’t know how to go about updating them only if they don’t match. If you or someone else can suggest which functions would do that, that’d also be great.

name tells it all :wink:
https://wiki.documentfoundation.org/Documentation/Calc_Functions/IF

Solved my problem.
• Made a macro that:
◦ copies the old data to a cell
◦ calls ".uno:UpdateTableLinks"
◦ forces a recalculation
◦ copies a cell that compares the old and new data using =EXACT, if true is empty and if false calls =NOW thus “freezing” the time of the last new dataset
• Enabled Iterations
• Used another cell with =IF to either copy the frozen time if present or reference itself.
It works, even if i dislike how it looks.