Field not displaying data from another data type

Hi,

The repeating group has a data type: employee. So the fields/ information here (except for employee status) are all stored inside “employee” data type.

But I need to display the employee status also in the same repeating group, even if its source is not from the same database “employee”

.

Sadly, it keeps getting this issue. And the data is not being displayed.

What should I do to display the employee’s current employee status even if it is source from another database?

This database structure doesn’t make sense to me.

If you really do need a separate data type for ‘Employee Status’ then I don’t understand why it needs ‘first name’ or ‘last name’ fields?

It should just have status (as text, fine if you need it to be completely custom and Option Sets don’t make sense here), and then another field called ‘Employee’ which had a data type of ‘Employee’.

Then in your repeating group you can just do a search the for all employee statuses with a constraint of employee = current cell’s employee. Sort it by Created Date in descending order to get the most recent one and select :first item in the dynamic expression.

2 Likes

because I want to track or have a database that shows the history of status of a specific employee. Which I also want to bet attached to the employee database. Is that possible?

when there is a need to pull all information in relation to a specific employee, then I would be able to show when the employee became active to the end of his/her employment.

I am now able to display data from a source/different data type even if the repeating group is “employee data type”. I did create a separate group within the repeating group, but instead referred to its source to the “employee status data type”

But I need to display their appropriate employee status, as per the database:

Is the “Employee Status” field in the “Employee” table a list or a single value?

If it’s a single value can you not just say “Employee’s Employee Status’s employee status” ? This will cause a round-trip to the server to grab it but it will work.

I do not have a separate field “employee status” in the “employee” data type or table. Instead what I did was to make a separate “employee status as a data type”.

I tried placing the employee status field inside the employee data type, but I notice that as I press my updated button, it appears to just put the status and leave out all the fields in the table.

No, I understand. You have an Employee Status type and an Employee type and you have a field in the Employee which is of type Employee Status - or a foreign key. If you don’t have this field then how will you know which status for each employee? The actual value stored in the Employee Status field in the Employee type is just a unique key of a record in Employee Status, it’s not everything in the Employee Status record, it’s a pointer to it. When you want to display the Employee Status in a text in an RG list you’d just point it to the Employee’s Employee Status and then you get the fields in the Employee Status record to select from. So you can set the following expression in the text label (you don’t need to do an additional Search for …)

Employee’s Employee Status’s employee status

Unless I’m missing something and it’s more complicated that it seems then this will do it for you. Hope it helps.

1 Like

If I understand it correct, I did remove the employee status type and instead make a field employee status inside the employee type/ database.

After configuring the update employee status button, the data: employee status was now capture and placed inside the employee type/ database. However, since it is only the status, the other fields were left out.

As a result, it only displayed the employee status (active) in the repeating group and left out the other data such as names, employee number, etc.

Okay, so I think I got to work on your suggestion here. I did follow through on your advice, and worked on the employee status field w/in the employee data type.

Then, instead of “creating a new thing”, I configured the “updated employee status button” to just “make changes to employee…”

I think this solved the issue.

Screen Shot 2022-02-08 at 11.12.38 PM

You need BOTH the Employee Status type and the field on the Employee for Status. Store the relevant Employee Status in the Status field on Employees when you’re creating an employee or when updating an employee’s status. Then when you need to display in a text element just add the expression “Employee’s Status’s employee status” (“employee status” being the name of status’ name on the Employee Status type.

1 Like

I used this expression to updated the employee type/ database about the “current” status of an employee. The employee type, now shows the status of the employee, but I am not sure if it can track the history since, it currently updates the entire employee type.

That looks right. To keep a history just add a Create a New Thing … action to the workflow to the Employee Status type with the new status info. You’ll probably need an Employee field on the Employee Status type so the history knows which employee it relates to.

If you need a straight list of statuses (eg for the user to select from) and a status history for each employee, then you can store your straight statuses without an Employee and your history records with an Employee. When you need a drop-down of just straight statuses which are not part of an employee’s history, put a constraint on your Do a Search For … in the selection element eg drop-down which only lists Employee Status where the Employee field is empty.

Hope that helps.

1 Like

Thank you very much. You’ve been helpful. I’ll keep this mind and revert to this when needed. I’ll try this one. Again, thank you

1 Like