Change data type of field

Hi all,

I am trying to see if there is a way to make a field, programmatically, change its data type.  I have a Personnel Action Request App - if the Employee is Active, I would like the Employee Number Field to be a ref to another data source, if the employee is an Applicant, I want the field to be typed in and not pulled from a list as they wouldn't be in the list. In the screen shot below, if the user picks JDE Active, I would like the Employee Number to be a ref field to the data source, called AllEmps, which is active employees.  If the user picks Applicant, or Mexico, I would like them to fill in certain fields, including the employee number.  If the latter 2 are the selections, then the other fields that are autopopulated based on the Employee Number ref, need to be filled in.  I hope that makes sense.  As always, thanks in advance for any help/advice.  P.S.  Currently, I have the ref field with Adds, so a user CAN type in the information, but it gets stored in the data source of the ref table, not the data source of the app data.    

PJMatelli_0-1646869928808.png

 

0 4 118
4 REPLIES 4

Hi,

If i understand your question correctly, you may accomplish this by:

1. Table "AllEmps" shall have column Employee Type (Data type: Enum): JDE Active, Applicant, Mexico

2. New PAR Table > Column Employee Number (Ref Data Type to Table "AllEmps" where Employee Number suppose is your key ID) > Auto Compute > Suggested Value > apply formula below:

 

SELECT(AllEmps[Employee Number....this is your Employee key ID], [Employee Type]=[_THISROW].[Employee Type])

 

By this, your will be able to dynamically shows Employee Number based on your selection of Employee Type

Thanks...trying that right now, will let you know!

So, I think maybe I wasn't clear enough.  The All Emps file does NOT contain the Applicants or Mexico people.  I need them to be able to fill in the fields if they are Applicant or Mexico and the ref to show up if they are JDE Active.  Hope that helps and thanks!

Any column attribute, including Type, will be applicable for all rows. For the same column, you cannot have one attribute applicable to certain rows but not for others. 

What you need is separate columns, and what you can do is control, based on the selected value, which column is shown to the user in the form so that it can be filled accordingly. 

Use the "Show?" and "Require?" fields in each column, with an expression like: 

AND(
  ISNOTBLANK([Employee type], 
  [employee type] = "one of the three values"
)

Top Labels in this Space