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
Community Champion
Community Champion

@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
Community Champion
Community Champion

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
Community Champion
Community Champion

@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
Community Champion
Community Champion

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

eka24
Community Champion
Community Champion

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 News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (2,831)