Expand my Community achievements bar.

SOLVED

Duplicating rawdata from one field into another field

Avatar

Level 2

I am seeking help to duplicate rawdata from one field into another field.

Here is what I am looking to do:

1.  There is a field named "FirstName" on my form, and another field named "FirstNameOnBadge" on the same form.

2.  "FirstName" field has unlimited characters size; "FirstNameOnBadge" field is limited to 25 characters.

3.  When I enter rawdata into the "FirstName" field, the first 25 characters of that rawdata should then appear in the "FirstNameOnBadge" field.

4.  I should be able to edit the rawdata in the "FirstNameOnBadge" field (up to 25 characters) and it would have no effect on the rawdata in the original "FirstName" field.

I need to keep these two fields separate and unique, since their respective rawdata will be going into different fields in different databases.

Would someone please let me know how to do this?

What are the settings and coding that would need to go into these fields?

Thank you in advance.

1 Accepted Solution

Avatar

Correct answer by
Former Community Member

On the exit event of the FirstName field put this code:

FirstNameOnBadge.rawValue = this.rawValue;

Set the FirstNameOnBadge field to a limit of 25 chars. When the name is copied it will truncate to 25 chars for you autmatically.

Note that this assumes that both fields are in the same subform. If not then you will have to include the path to the FirstName field as well.

Paul

View solution in original post

5 Replies

Avatar

Correct answer by
Former Community Member

On the exit event of the FirstName field put this code:

FirstNameOnBadge.rawValue = this.rawValue;

Set the FirstNameOnBadge field to a limit of 25 chars. When the name is copied it will truncate to 25 chars for you autmatically.

Note that this assumes that both fields are in the same subform. If not then you will have to include the path to the FirstName field as well.

Paul

Avatar

Level 2

Okay, here's a little twist I would like to make to improve functionality of the "FirstNameOnBadge" field.

If the rawdata entered into the "FirstName" field is 25 characters or less, the rawdata would go into the "FirstNameOnBadge" field as-is and the "FirstNameOnBadge" field would be read-only.

However, if the rawdata entered into the "FirstName" field is more than 25 characters, the rawdata would go into the "FirstNameOnBadge" field and would be truncated to 25 characters... AND the "FirstNameOnBadge" field would become editable so that the rawdata in there could be edited (again, within a limit of 25 characters).

Avatar

Former Community Member

Created a sample for you. The code is on the exit event of the FirstName field.

Paul

Avatar

Level 2

And again... works perfectly! 

Thank you again, Paul... I really appreciate your help.

Glenn

The following has evaluated to null or missing: ==> liqladmin("SELECT id, value FROM metrics WHERE id = 'net_accepted_solutions' and user.id = '${acceptedAnswer.author.id}'").data.items [in template "analytics-container" at line 83, column 41] ---- Tip: It's the step after the last dot that caused this error, not those before it. ---- Tip: If the failing expression is known to be legally refer to something that's sometimes null or missing, either specify a default value like myOptionalVar!myDefault, or use <#if myOptionalVar??>when-present<#else>when-missing. (These only cover the last step of the expression; to cover the whole expression, use parenthesis: (myOptionalVar.foo)!myDefault, (myOptionalVar.foo)?? ---- ---- FTL stack trace ("~" means nesting-related): - Failed at: #assign answerAuthorNetSolutions = li... [in template "analytics-container" at line 83, column 5] ----