AnsweredAssumed Answered

Edit concatenated name field updates individual name fields and vice versa

Question asked by DaleLong on May 24, 2012
Latest reply on May 25, 2012 by DaleLong

I'm wondering if anybody has a technique for achieving this? Basically, we have a concatenated name field that calculates a result like this:

 

LastName, FirstName

 

Currently, the concatenated name updates if you edit one of the individual name fields using a formula something like this:

 

Let

(

[

~firstName = fname ;

~lastName = lname ;

~noFirstName = IsEmpty ( ~firstName ) ;

~noLastName = IsEmpty ( ~lastName ) ;

~separator = Case ( ~noFirstName or ~noLastName ; Null ; ", " )

] ;

 

 

~lastName & ~separator & ~firstName

)

 

 

This is essentially controlling for situations where we have only a first or last name, no insertion of a separator is to occur in this case.

 

 

Is it possible to have this work in reverse using only auto-enter calcs? In other words, if you edit the concatenated name, the first and last name individual fields update accordingly. I've tried a few things, but so far I've only been able to get the updates to work one way or another, not both ways. The last thing I tried was something like

 

 

lname =

Let

 

 

(

[

~separator = ", " ;

~nameList = Substitute ( fullName ; ~separator ; ~carriagereturn ) ;

~firstName = GetValue ( ~nameList ; 2 ) ;

~lastName = GetValue ( ~nameList 1 )

] ;

 

~lastName

 

)

 

But I can't quite get it to work the way I want; the updates either don't happen at all, or will only happen one way if I toggle the Do Not Replace Existing Value option on one field or the other.

 

I imagine I could probably get this to work using a script trigger; but I'm curious if somebody has a technique for this that works at the auto-enter calc level?

Outcomes