Forums

Copying a field value to a new table

nicholashg 23 May, 2011
How can I copy a value (cf_id) from a single loaded record to a new form (under a new field name) in order to create a relationship. In this way, `cf_id` from the source table_1 would become `source_cf_id` in the new table_2.

The cf_id from table_1 is obtained using the DB Record Loader in the new table_2 submission form.
I tried a number of things (Model ID, no Model ID, custom mysql instructions) but can't get one to work.

Any help appreciated.

Nick
GreyHead 23 May, 2011
Hi Nick,

You can pass it to the new from in the form URL; or perhaps better use the Session Save & Session Get actions in CFV4.

Bob
nicholashg 23 May, 2011
Hi Bob,

I'm sure that would work but I stumbled across a beginner's solution in the meantime:

value="<?php echo {profile.cf_id}; ?>" name="source_cf_id"


Just writes the value to the required field!

Thanks,
Nick
GreyHead 23 May, 2011
Hi Nick,

Great - that one is new to me - I wouldn't have expected it to work.

Bob
This topic is locked and no more replies can be posted.