Display a Single Value from Array in a text box based on the _id from a different array

From the rest API I have an array of dailyReports with pointer._id to a collection of Foremen. I also retrieve that array of Foremen with their first and last names.

I create a grid that repeats the dailyReports records based on the return value from the rest API. I would like to populate a field in that list with the assigned Foreman's name.

I am currently using a select input that populates from the Foremen array and then receives a value from the dailyReport.foreman._id to display the Foreman name.

I don't like the way this lays out because the select doesn't fit the full name and the formatting doesn't fit the other data being displayed.

Is there a way to display the Foreman name in a text field based on the dailyReport.Foreman._id and the Foremen Array? Something like

"{{dailyReport.ForemanID}} as {{Foreman.firstName}} for Foreman in Foremen"

Or do I have to search through the foremen array for each dailyReport record and retrieve the name that way.

This is something I will need to use all over my application so it would be nice if there was a simple way to do this.
1 person has
this question
+1
Reply