Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8344753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:28:04+00:00 2026-06-09T06:28:04+00:00

Okay lets say I have a basic demographic content type (Client) that I am

  • 0

Okay lets say I have a basic demographic content type (Client) that I am saving as a node.

I need to make a key for an external database that we occasionally need to work with.

I want Drupal to take the fragments of three fields being collected in the Client content type and join them into a single field to be saved within the Client content type. Ideally this should be done when I create a new (Client) node.

The new field should contain the following
First 3 letters of firstname
First 3 letters of lastname
and last 4 digits of Social Security Number.

For example
firstname: John
lastname: Doe
SSN: 123-45-6789

A new field should be created, let’s call it fk_database. Using the example above the field >created would be -> johdoe6789

Can this be done via Rules module, or should I approach this in a different way? If I need to do this via a PHP script where exactly should that be added in the Drupal structure?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T06:28:05+00:00Added an answer on June 9, 2026 at 6:28 am

    The easiest way would probably be to use the Computed Field module, it’s pretty much built for exactly what you want to do:

    Computed Field is a very powerful CCK field module that lets you add a custom “computed fields” to your content types. These computed fields are populated with values that you define via PHP code. You may draw on anything available to Drupal, including other fields, the current user, database tables, you name it.

    If you do need to do it in code though, have a look into hook_entity_presave() which would probably be the best place to run your code from.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay lets say I have a list, and I want to check if that
Okay so let's say I have class A... CLASS A has a method that
Okay, lets say I have a URL like so, which is mapped via HTTP
Okay, so basically lets say i have a matrix: matrix([[0, 1, 2, 3, 4],
Okay, lets say I have the following text... <h2><a name=test1></a>Test 1</h2>test 1 text <h2><a
Okay, let's say I have a database Class Content(db.Model): code=db.TextProperty() And I wanted to
How can I re-use a function? Okay lets say I have this main function
Okay so lets say I have a list of addresses in a text file
Okay, this one is pretty complicated... lets say I have an array called $data
Okay, next PHPExcel question. I have an HTML form that users fill out and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.