Hello @Jayron_Rosel
I assume you are using Company Name as a key to distinguish which record of getting data from. It depends on your situation, but this is an example script that could get and pass a field value from one app to another when a button is pressed.
(function() {
"use strict";
var AppId = *App ID you are retrieving data from*;
kintone.events.on(['app.record.edit.show', 'app.record.index.edit.show'], function(event) {
// Placing a button on a space field
var btn = document.createElement('button');
btn.id = 'my_space_field_button';
btn.innerHTML = 'Space Button';
btn.onclick = function () {
kintone.api(
kintone.api.url('/k/v1/record', true),
'GET', {
app: AppId,
id: event.record['CompanyName'].value
},
function(resp) {
var record = kintone.app.record.get();
record['Street_Address'].value = resp.record['street_address'].value;
kintone.app.record.set(record);
}
);
}
kintone.app.record.getSpaceElement('my_space_field').appendChild(btn);
});
})();
Please refer to the Ref. for more examples.
For your information, it depends on your situation, but you can use a lookup field to copy data from another app.
Ref.: