The Client Details table should always contain the most recent job coach entered.
The History Table is a running record of all job coaches the client has had.
So on my form I would like to update the job coach name in table 1 and add a new record to table two. That part is easy.
What I need to do is only insert a record into the history table if it is different than the Client Details table. As it is, everytime the client details form is edited it also creates an unnecessary record in the history table. I need the insert to only insert if the job coach value is changed.
I hope I explained that well. Thanks for any help you can offer. Much appreciated.
Good idea on the single query. I never thought of that. The problem I would have is writing the condition. As far as I know the expression builder is not available in the server connect action editor. And I'm not very knowledgable in coding.
But your example condition does make sense. Thank you so much. I am sure I will have more questions as I work this out.
When you have a query and this condition query.count()>=1: then the condition will be true only if the query returns at least one record.
In this case, if no match (0 results) then it will return false
Ah, I think I get you on the count. However that will bring up any matching records. A client could have coach A for a few months then change to coach B and then change back to coach A.
I think your initial suggestion will work. I am working on that now. Your screenshots are a huge help. Thank you so much. I am sure I will be marking that as the solution shortly.