cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Pre-populate combobox values from an entity on re-launching the app

Hey Everyone,

 

I have a simple profile screen that picks up employee information from an excel and auto-populates fields based on the logged-in email ID. The only editable field is the Combobox where users can search and select multiple skills. This field gets disabled on clicking the 'Save' button and necessary details get stored in an entity in the CDS

 

On closing and re-launching the app, I want to see the selected skills in the Combobox for that particular employee.

 

Attempt 1:

Apps -> On Start -> If(Talent_Skills_v1.Employee_ID = TextInput4.Text, Concat(ComboBox1.SelectedItems, Skills, ", ") = Last(Talent_Skills_v1.Skills_list))

 

Attempt 2:

Apps -> On Start -> If(Talent_Skills_v1.Employee_ID = TextInput4.Text, Set(Skills, Last(Talent_Skills_v1.Skills_list)))

 

Nothing turned out to be successful.

 

I would appreciate any response that would direct me towards achieving the solution.

 

I am new to power apps and I have a tight deadline to produce something. I have looked through a lot of videos but cannot figure out that easily. I appreciate any guidance/methodology if not the actual solution.

 

Thanks!!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted

Hi @Anonymous ,

 

Do the selected skills Store in Skills_list column of Talent_Skills_v1, right?

Please try this:

DefaultSelectedItems of combo box:

Filter(Skill_news, Skills in Split(LookUp(Talent_Skills_v1, Employee_ID = TextInput4.Text).Skills_list, ","))

 

Hope this helps.

Sik

View solution in original post

6 REPLIES 6
Highlighted
Super User III
Super User III

This is another approach. Insert a Textbox1.

Then in the Default of the Textbox1 put If(YourFormName.Mode=FormMode.New,Combobox1.Selected, Parent.Default)

This means in Submitting your form or Patching, you Patch Textbox1 not the combobox1.

So in view or edit mode of the form you should see the record that was selected in the combobox1 before saving.

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.

Highlighted
Anonymous
Not applicable

Hi @eka24,

 

1. I have not used a form to build out my profile page since all fields except the Combobox were text inputs that are defaulted to specific values.

2. I do not have an issue in saving/viewing the saved skills in the Combobox. I have written a collect statement which would copy the skills(deconstructed it using 'concat' to display as text) and the other fields to an entity each time I click Save. Patch would probably update the same row which I might need in the future so I will implement that.

3. If I implement a patch which updates the rows in my entity(on saving the app), close the app and re-launch the app after a couple of days, will I be able to see the skills auto-populated in the text box? If that is the case, will the Combobox be empty? I was under the assumption for auto-population you need to extract the data again from the entity on starting the app.

4. My 'Skills' Combobox uses a separate entity for the selection of skills. Other fields use a different entity and my selected skills along with employee_ID are stored in a separate entity. In that case, how can I ensure correct auto-population for a particular employee_ID?

 

I know this is too much to digest. I am looking to learn the implementation and design ideas so that I can implement it clearly and take care of future issues that may arise by myself. Once again, thank you so much for your help.

Highlighted
Community Support
Community Support

Hi @Anonymous ,

 

I found that the Skills_list field is Text type and stores all selected skills separated by commas, the combo box item is from CDS and corresponding field name is Skills, right?

If my understanding is right, try to modify the DefaultSelectedItems of combo box as follows:

 

RenameColumns(Split(LookUp(Talent_Skills_v1, Employee_ID = TextInput4.Text).Skills_list, ","),"Result","Skills")

 

If this doesn't work, please share the Combobox.Items property and Type of Skills field in entity.

 

Update: is the Skills field in the screen is a text box or combo box? If it is a text box, and you wanna show the last selected skills (store as string separated by comma), try this code to Textbox. Default property:

LookUp(Talent_Skills_v1, Employee_ID = TextInput4.Text).Skills_list

Sik

 

Highlighted
Anonymous
Not applicable

Hi @v-siky-msft  I found that the Skills_list field is Text type and stores all selected skills separated by commas, the combo box item is from CDS and corresponding field name is Skills, right? - Yes

 

I tried this and the selected items disappeared on clicking Save.

RenameColumns(Split(LookUp(Talent_Skills_v1, Employee_ID = TextInput4.Text).Skills_list, ","),"Result","Skills")  

 

Then I tried this: Apps -> OnStart -> If(EnableCombo = false, RenameColumns(Split(LookUp(Talent_Skills_v1, Employee_ID = TextInput4.Text).Skills_list, ","),"Result","Skills"))

 

It did not work. I have attached the screenshots to answer your questions. Thanks!

Highlighted

Hi @Anonymous ,

 

Do the selected skills Store in Skills_list column of Talent_Skills_v1, right?

Please try this:

DefaultSelectedItems of combo box:

Filter(Skill_news, Skills in Split(LookUp(Talent_Skills_v1, Employee_ID = TextInput4.Text).Skills_list, ","))

 

Hope this helps.

Sik

View solution in original post

Highlighted
Anonymous
Not applicable

@v-siky-msft I figured out the solution. I had to rename columns as the error was due to a confusion in the name. Thank you so much for your help! Apparently, you have to include the powerapps name column instead of the name given by the user while adding the entity.

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,940)