Made my clever form autofill also work during edits

I originally wrote this to ask how to make the solution work during edits but in the process of explaining I figured out how to do it. It's pretty basic but I thought I'd share.

Similar principle to mailing vs billing addresses, I have two sets of email and phone numbers which may or may not be the same. I felt very clever by coming up with what I thought was a neat solution to auto-fill the latter set. The forms asks if the following information is the same as previous with a Yes/No button. The second email row has this formula in Initial Value. [Email] is the column of the first email.

 

 

IF(
([Same contact?]="Yes"), [Email], ""
)

 

 

Phone is the same but referring to the previous phone number.

Then to ensure everything aligns and a user doesn't say they're the same then edit them so they're actually different both the latter contact rows have the following in their Editable_If

 

 

NOT([Same contact?]="Yes")

 

 

So I felt very smug about this neat solution until I tried editing an existing entry and realised it didn't work anymore. I looked it up so I understand that Initial Value only works upon creation unless you select Reset on Edit. But I don't want to reset the second contact and phone rows on edit for what I hope are obvious reasons. I understand you can make the reset conditional but I can't think of what condition I could put in that wouldn't break something else.

The solution was actually embarrassingly obvious. Just put this in the Editable_If:

 

[Same contact?]="Yes"

 

I'm not a complete idiot in that I did think of having the Yes/No trigger the reset but I thought it would result in any row with "Yes" selected having its duplicate details wiped. But I am still mostly an idiot because I didn't realise that my code would then immediately repopulate it.

I'll probably trip over a new problem with forms soon but for now I shall bask in the satisfaction of my bare minimum competence.

0 0 71
0 REPLIES 0
Top Labels in this Space