}
For example I have created a Custom Field : SchoolName. How would I get / retrieve data of that Custom Field in a input field in another page? Kindly help
@russian-dima Thanks for your kind support and quick reply. : )
I am not able retrieve by this code. This is how I pasted and run your code in backend - contacts2.jsw. But I think having some issues. I have used a variable to retrieve data in an input field called - #aadhar and extendedField also having this name - aadhar. But unfortunately I am still not getting. Have I done something wrong. Plz have a look.
MY FRONTEND – import { retrieveExtendedField } from ‘backend/contacts2.jsw’ ;
Dear @russian-dima , I liked and marked just because after so much efforts someone gave me some hope. So, I just marked it in a hurry. I thought it would work like you are amoung the best. But, alas it didn’t work out for me. I am still nowhere. Please help.
If you would use the console a little bit more, you would be able to solve your issue by your own!
USE MORE THE → CONSOLE!
Take a look at the last provided CODE and try to understand what was missing in my first provided INCOMPLETE code and in your improved (also not complete) code-version.
Open your CONSOLE and take a look onto results. Which results do you get?
When accessing contact data, extended field values are available at extendedFields[key]. For example, if thekeyis "custom.notes", thevaluecan be accessed at extendedfields["custom.notes"]. Once set, key cannot be modified, even if displayName changes.
Make clear what’s your correct fieldKey-ID, but how ???
Generate a little TEST-CODE, like…
$w.onReady(() => {
let fieldKey1 = "aadhar";
let fieldKey2 = "Aadhar";
let fieldKey3 = "custom.aadhar";
let fieldKey4 = "custom.Aadhar";
//---------------------------------------------
let fieldKey5 = "ironman";
let fieldKey6 = "Ironman";
let fieldKey7 = "custom.ironman";
let fieldKey8 = "custom.Ironman";
$w('#retrieve').onClick(async() => {
let aadhar = await retrieveExtendedField(fieldKey1);
console.log("aadhar: ", aadhar);
$w('#aadhar').value = aadhar;
});
});
You can see 8-different generated test-key-fields to test, which one will work of them. Test all 8 keyFields to find the right SYNTAX.
All you have to do is just to change → …
let aadhar = await retrieveExtendedField(fieldKey—>1 <----);
And run your test 8x!
Hi Sanawad, the getExtendedField function does not get you the data you are looking for. It only retrieves general information about the extended field, i.e. the name and the field key. Once you know the field key, you don’t need to run this function anymore. (But you’ll probably recognize the field key anyway)
To get the actual extended field data you can use one of two backend functions
contacts . getContact ( contactId , options ) using the contactId of the current user
or, if your extended field is also a custom info field for members, it can be retrieved through currentMember . getMember ({ fieldsets : [ ‘FULL’ ]})
The returned values contain the extended field data.
@verbaldancing Thank you so much for this precious information. I didn’t knew that I tried everything and possibly every code from previously asked questions. But I think due to many depreceated functions I was not able to get data. I request you if is it possible to have sample frontend code for that. I am trying my best after this info but If you could, It would be big help : )