Use the Form in Edit Mode block to determine if the form is being used to edit exiting data (the value is true) or to add new data (the value is false).
Form in Edit Mode block
This block only works when used in Form type pages. See Working With Forms to learn about how forms work.