Creating custom array keys on gravity forms entry

I’m assuming your underlying need is to assign a role for each field on different forms. So the Name field on Form A might be field ID 1 and the Name field on Form B might be field ID 2. Both fields represent the role of “Primary Contact Name”. The simplest way to do this would be to give the field this “role” with the Admin Label field setting. Then you can fetch for the form object for the given entry, loop through the fields, check for your desired Admin Label (e.g. role) and do what you need to do with the data.

$form = GFAPI::get_form( $entry['form_id'] );

foreach( $form['fields'] as $field ) {
    switch( $field->adminLabel ) {
        case 'primary_contact_name':
            $primary_contact_name = $entry[ $field->id ];
            break;
    }
}

That’s just a rough example of how it might work as a reliable way to get the specific type of data you want from multiple entries.