I'm sure I'm doing something silly here.
I have got my component correctly retrieving data using wire and showing it on the screen via an Id getter.
I want to use that ID later on in the same javascript class to call an API with a dynamic parameter, how can I do this?
import { LightningElement, track, wire, api} from 'lwc';
import { getRecord } from 'lightning/uiRecordApi';
const FIELDS = [
'Contact.ExternalId__c'
];
export default class HTTPCalloutInLWC extends LightningElement {
@api recordId;
@track claims;
@wire(getRecord, { recordId: '$recordId', fields: FIELDS })
contact;
get Id() {
return this.contact.data.fields.ExternalId__c.value;
}
// Making Callout using Fetch
connectedCallback() {
fetch("https://SOMEURL/IWantMyExternalIdHere",
{
<snip>