Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
how to manipulate a custom attribute 'custom:variable_name' in Javascript

So, using AWS Cognito I created a custom attribute (special_name) which I can access using axios and AWS's Auth.currentUserInfo(). Using my browser's JavaScript console I can see the variable as:

attributes: custom:special_name: 'foo'

Great.

But if I console.log(custom:special_name) I get errors or at best 'undefined'

I'm using Visual Studio Code which really doesn't like the format custom:special_name.

I've already searched on this site and the ideas given, e.g. ['custom: special_name'] also don't work.

I feel like I'm missing something very obvious.

Please put me out of my misery.

Thanks.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

But if I console.log(custom:special_name) I get errors or at best 'undefined'

Did you mean:

attributes['custom:special_name']

It seems your variable is a member of the attributes object, not a global one. In that case, the square bracket syntax will work.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!