cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
lumpkinbd
Regular Visitor

Combo box search on existing form

I have a sharepoint list. The list is managed via access DB by employees at my office. At remote offices HR will be using a PowerApps form to enter a specific form into the file. However there are thousands of lines in the list. I created the form. Cards on the form include EmployeeID(text), Full NAme(text), Station#(text), Clearance Form(toggle), & Attachment(attachment). When they open the editform I would like there to be a combo box that populates the form with the correct employee info that is already created in the list so they can hit the toggle on the clearance form and attach the form. I have been researching this for days and have found how to add the combo box, how to make it linked to the employeeID, but not how to make the selected item in the combo box show the data on the form from the list. Is this even possible or have I been wasting my time? 

1 ACCEPTED SOLUTION

Accepted Solutions
v-siky-msft
Community Support
Community Support

Hi @lumpkinbd ,

 

Do you want to create a new record or edit the existing record?

 

If you just want to edit the existing record retrieved from the combobox, it is easy to implement it. You only need to set Items property of Form: LookUp('SP list', SSN= ComboboName.Selected.SSN)

 

If you want to create a new record based on the information retrieved from combobox, you need to modify the Default property of each control.

1. set OnChange property of combobox: Set(Var1, LookUp('SP list', SSN= ComboboName.Selected.SSN))

2. modify the Default property of DataCardValue in SSN card: If(FormName.Mode=FormMode.New, Var1.SSN ,Parent.Default)  

3. the same for other columns.

GIF_81.gif

Hope this helps.

Sik

View solution in original post

8 REPLIES 8
JayMagness
Super User
Super User

Hi,

 

I actually created a special calculated field in the SharePoint table using the Created date (This never changes) this will allow for a new ID every second, then associate it with the name you want to retrieves.

 

if you want can send me an email and I will help you with a teams session. jay@research-nest.com

Thanks for the reply Jay. Unfortunately we aren't using TEAMS yet fully. I guess they are phasing it in. I work for the Department of Veterans Affairs. 

 

Here is what it looks like. 

 

When you find the correct SSN in the combo, and select it, it should pull the "Full Name" and "SSN" entries from the SharePoint List.

 

My guess is that there is some kind of code I need to enter into the "On Select" item in the combo box that will update those fields, but I have struck out in finding it. 

v-siky-msft
Community Support
Community Support

Hi @lumpkinbd ,

 

Do you want to create a new record or edit the existing record?

 

If you just want to edit the existing record retrieved from the combobox, it is easy to implement it. You only need to set Items property of Form: LookUp('SP list', SSN= ComboboName.Selected.SSN)

 

If you want to create a new record based on the information retrieved from combobox, you need to modify the Default property of each control.

1. set OnChange property of combobox: Set(Var1, LookUp('SP list', SSN= ComboboName.Selected.SSN))

2. modify the Default property of DataCardValue in SSN card: If(FormName.Mode=FormMode.New, Var1.SSN ,Parent.Default)  

3. the same for other columns.

GIF_81.gif

Hope this helps.

Sik

View solution in original post

OK. So that allowed it to be populated with the data, but when I hit save after I made changes, it did not update the record. Is there something else I need to check before it will save the changes made? Do I need to make it FormMode.Edit vice FormMode.New?

Also, I almost forgot. It isn't allowing me to link the attachment field to that record. The Field Column Name in the list is called "Documents" but it doesn't show up when I search to add it to the Form.

Hi @lumpkinbd ,

 

Please answer my first question. Do you want to create a new record or edit the existing record?

 

If you only want make some changes on the existing record,  Please set the From Mode to Edit, and set Items property of Form: LookUp('SP list', SSN= ComboboName.Selected.SSN). Then use SubmitForm() function to save the modified data.

Sik

Hi @lumpkinbd ,

 

Did the column renamed?

Here is a limitation in PowerApps that it only display the initial column name.

Hope this helps.

Sik

So as it turns out, I overlooked the fact that I had accidentally created a "custom" datacard for the attachments. Once I replaced it with the actual column, Everything worked as you posted in your original response. I very much appreciate your assistance. I have learned a great deal from this experience.

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Carousel April Dunnam Updated 768x460.jpg

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

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