cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rmaziwis
Resolver I
Resolver I

How to punch in information in a specific field and it returns values that autopopulates other fields

Hi All 

 

Iam building a form for a requirement I have but Iam not quiet sure how to resolve this.

I have a SQL table called Employees that has all the company Employee details  like the Site ,Name ,Job title and Department .

I want to be able to punch in my employee number BA1234 on the first field called Employee Number (text ) field nvarchar data type.

It will then populate Site 

                                Job title 

                               Department 

 

I had managed using cascading  dropdowns but the users don't want to scroll the list looking for an Employee number they  want to punch in the number and based on the information in the database it will populate  the site ,the job title ,the department of that employee. 

Autopopulate usingEmployee code.PNG

 

 

 

 

3 ACCEPTED SOLUTIONS

Accepted Solutions
mdevaney
Super User
Super User

@rmaziwis 

Create an Edit Form with the DATASOURCE being your Employees table.  Then make the Item property this code:

 

LookUp(Employees, ‘Employee Number’ = TextInput_EmployeeNumber.Text)

 

Note: you should place the Employee Number Text Input outside of the Edit form

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

eka24
Super User
Super User

I suggest if possible to replace the dropdowns with Textboxes and proceed as follows:

 

Job title

LookUp(Employees , employeenumber=EmployeesNoTextbox.Text,Jobtitle)

 

Department

LookUp(Employees , employeenumber=EmployeesNoTextbox.Text,Department)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

 

View solution in original post

@rmaziwis 

#1  Please share a screenshot of the error message you are getting.  This is always helpful when problem solving.

 

#2  You said you put the formula in the Items property of the form.  However, the property is called Item which makes me wonder if you put this code in the gallery by mistake.

 

#3  Make sure the the Employee Number text input is outside of the form like my instructions said.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

View solution in original post

10 REPLIES 10
mdevaney
Super User
Super User

@rmaziwis 

Create an Edit Form with the DATASOURCE being your Employees table.  Then make the Item property this code:

 

LookUp(Employees, ‘Employee Number’ = TextInput_EmployeeNumber.Text)

 

Note: you should place the Employee Number Text Input outside of the Edit form

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

eka24
Super User
Super User

I suggest if possible to replace the dropdowns with Textboxes and proceed as follows:

 

Job title

LookUp(Employees , employeenumber=EmployeesNoTextbox.Text,Jobtitle)

 

Department

LookUp(Employees , employeenumber=EmployeesNoTextbox.Text,Department)

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

 

 

 

Hi 

 

Iam currently testing in my test app the table is called (Advanced Cleaning staff ).

The Employee is the (employee number) ,I have created a an EditForm

 

When I put the formula in the items property Iam getting an error 

LookUp('[rp].[AdvancedCleaningStaff]',Employee=TextInput1_Employee.Text)

ErrorEmp.PNGError 2.PNG

 

@rmaziwis 

#1  Please share a screenshot of the error message you are getting.  This is always helpful when problem solving.

 

#2  You said you put the formula in the Items property of the form.  However, the property is called Item which makes me wonder if you put this code in the gallery by mistake.

 

#3  Make sure the the Employee Number text input is outside of the form like my instructions said.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Hi 

 

I have just read your Note and have corrected my self.

 

Correction.PNG

If employee is the number in your table as you said, what column do you want to see in the Textbox

LookUp('[rp].[AdvancedCleaningStaff]',Employee=TextInput1_Employee.Text,ColumnToSee)

 

Example

LookUp('[rp].[AdvancedCleaningStaff]',Employee=TextInput1_Employee.Text,JobTitle)

 

Dont repeat Employee twice as you have indicated in the other formula

------------

If you like this post, give a Thumbs up. Where it solved your request, Mark it as a Solution to enable other users find it.

@rmaziwis 
Please indicate who you are talking to in the thread using the @ symbol.  I don't know who you are talking to: myself or @eka24 .

my apologies @rmaziws you really helped thanks 

@eka24 you really helped thank you .

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (5,222)