NFC card and recording key in employee card

Hello everyone, I have a question again. In the employee table, the key is the employee's service number and, among others, there is a row with the number of the EM card. In the task form, the line is a reference to an employee, I need the employee I need to be selected by reading the card, but since the card number is not the key of the employee record, nothing comes out, help what to do?

Solved Solved
0 4 302
1 ACCEPTED SOLUTION


@Auron wrote:

there is a row with the number of the EM card.


Do you mean "column" rather than row?

If so, then in your Task Form, you will need 2 columns - one for reading the NFC tag data and a separate one, likely a Ref column, that sets the associated employee

You would assign the Employee using a LOOKUP() function against the Employee table using the NFC tag data.  Let's assume your columns in the Task Form are [Card] and [Employee].  And in the Employee table you have [Card ID] and [Employee ID] columns.  [Employee ID] is the key column.  The expression you would set in the [Employee] column could be like this:

LOOKUP([Card], "Employees", "Card ID", "Employee ID")

NOTE: You will need to change these table and column names to match those in your app.

Whether you place this expression in the Initial Value or as an App Formula, will depend your specific needs in the app.  If you want the assigned Employee controlled ONLY through the reading of cards then place the expression in the App Formula.  If you need to be able to change this assigned Employee, then place the expression in Initial Value and then provide a dropdown to select another Employee and/or set a "Reset on Edit" expression to also allow re-scanning of a card to re-assign an Employee.

View solution in original post

4 REPLIES 4

Steve
Platinum 4
Platinum 4


@Auron wrote:

there is a row with the number of the EM card.


Do you mean "column" rather than row?

If so, then in your Task Form, you will need 2 columns - one for reading the NFC tag data and a separate one, likely a Ref column, that sets the associated employee

You would assign the Employee using a LOOKUP() function against the Employee table using the NFC tag data.  Let's assume your columns in the Task Form are [Card] and [Employee].  And in the Employee table you have [Card ID] and [Employee ID] columns.  [Employee ID] is the key column.  The expression you would set in the [Employee] column could be like this:

LOOKUP([Card], "Employees", "Card ID", "Employee ID")

NOTE: You will need to change these table and column names to match those in your app.

Whether you place this expression in the Initial Value or as an App Formula, will depend your specific needs in the app.  If you want the assigned Employee controlled ONLY through the reading of cards then place the expression in the App Formula.  If you need to be able to change this assigned Employee, then place the expression in Initial Value and then provide a dropdown to select another Employee and/or set a "Reset on Edit" expression to also allow re-scanning of a card to re-assign an Employee.

Yes, it works. Thank you very much.

Steve
Platinum 4
Platinum 4

@WillowMobileSys wrote:
LOOKUP([Card], "Employees", "Card ID", "Employee ID")

 

Should be:

LOOKUP([_THISROW].[Card], "Employees", "Card ID", "Employee ID")
Top Labels in this Space