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

217
Views
AngularJS/JavaScript - How to rename an array key name

I have an application that reads an excel file, and displays its contents in an html table.

These elements are in an array called "AgendaItems".

There are 2 files the user can read, each is formatted with some differences. Both have 3 columns.

File 1: AgendaItem, LegistarId, Title File 2: Agenda #, File #, Title

I am able to read the file and populate the array $scope.AgendaItens with the contents of either file, depending what the user selects.

My problem is that before making these modifications to accept a second file with a different format, I used:

<td scope="row">{{ai.AgendaItem}}</td>
<td>{{ai.LegistarID}}</td>

When processing the new file, now the array contains: Agenda #, and File #, which are equivalent to AgendaItem, and LegistarID respectively.

Is there a way to, in the HTML choose which value to display? for example, if array has AgendaItem, display AgendaItem, if array has Agenda #, display Agenda #?

Or, is it possible to rename a the name of a key, from Agenda # to AgendaItem and from File # to LegistarID?

Please let me know if I need to post more details, more code in order for me to be able to get help.

Thank you in advance, Erasmo

about 4 years ago · Juan Pablo Isaza
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!