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

Unable to re-populate default selected items of combobox on app start using flow response parameters

Hey Guys,

 

I have created a flow that is able to extract a bunch of strings from a stored procedure in my on-premise SQL server management studio. The output of the stored procedure is as follows:

 

{
  "ResultSets": {
    "Table1": [
      {
        "description""Xcode"
      },
      {
        "description""XML Path Language (XPath)"
      }
    ]
  },
  "ReturnCode"0,
  "OutputParameters": {}
}
 
The response is ResultSets.Table1 which is:
[
      {
        "description""Xcode"
      },
      {
        "description""XML Path Language (XPath)"
      }
    ]
 
Screen OnVisible property:
Collect(User_skills, GetUserSkillsFlow.Run(LookUp('[dbo].[user]', email = varUser.Email, id))) which yields an empty collection of type 'Table'
 
DefaultSelectedItems property of Combobox : User_skills collection
 
The idea is to populate the default selected items when the user visits the page. Please let me know which part should be changed to achieve the desired result. Thanks!
14 REPLIES 14
Anonymous
Not applicable

Hey @KroonOfficeSol ,

 

Skills table - used to populate the combo box in edit mode. a list of pre-determined 2000 skills that cannot be edited.

expertise table - used to populate the dropdown in the gallery in edit mode. a list of 4 pre-determined values that cannot be edited. 

Objective - Once these items are saved for a particular user, they should be used to populate default values on launching the app.

 

This property expects a record or collection (for multiselect). You should use the LookUp() formula and use ThisItem.PropertyYouLikeToLookupOn. Also get rid of all the search(0 and filter() formula's, then are not needed - The search formula is to search all the skills in the gallery as tens of skills can be listed(it would be a pain to manually go through them). The items of the gallery are editable as well. If I add a new skill in the combo box, the skill is reflected in the gallery and the user is able to select an expertise_level. Once he clicks save, power apps will trigger a flow and write them to the database. Next time, the user logs in, the objective is achieved with the user_skills view in the default selected items I guess.

I am using the user_skills in the combo box only for the purpose of default selected items. On edit mode, the Combobox should be populated from the skills table, and the gallery dropdown from the expertise table.

In short, I do not think I can use a single table for selecting new skills/expertise and populating default selected items. I cannot eliminate search as I do not want users to scroll through the gallery. I sincerely hope I have made my difficulties clear with this message. I guess it is tricky to use different tables/logic for the Combobox and the gallery based on edit/disabled mode but I guess I cannot think of any other way keeping DB design and normalization in mind.

@Anonymous, what you say doesn't make sense at all.

 

Maybe I don't understand your dataset, but I would presume that a specific person can have multiple skills and for each skill he has an experience level, right. The combo box says something about the level of the skill in the row (read ThisItem) of the gallery.

 

So the items on your combobox are the 4 pre-determined values that cannot be edited, right? And the DefaultSelectedItem is one of those 4 items. In your Skills table there should be an ExperienceID int column with a reference to the Experience table (which again holds the 4 items which they can select). So on the combo box.items you have to put in at least the Experience ID Field and a name field you want to show. The you put the same on the DefaultSelectedItems and do a lookup with the ThisItem.ExperienceID.

 

This should be right, or else the experience is related to the Skills table. In this case the Skill has one or many related records in the Experience table and there should be a SkillID int field with a relation, right. So there should be a multiselect combobox used then, but you could wonder why then not a gallery inside the gallery item?

 

In both cases you take the formula you use on the ComboBox.Items and do a LookUp() or Filter() at the DefaultSelecteditems property. With first you get a record - single selection combobox - and with second you get a collection - multiselect combobox - with the same schema as the ComboBox.Items. When you don't have the same schema you will get an error. 

 

 

Btw, the part about adding a new skill directly in the gallery is a wrong approach, because the gallery shows the already existing records. You better add a simple form to add a new skill for the user.

Anonymous
Not applicable

So the items on your combobox are the 4 pre-determined values that cannot be edited, right? - No. The combo box is the label on the screenshot called "skills". The items of Combobox are the 2000 skills from which you can only select. The items of the drop-down in the gallery are the 4 levels from which you can only select. So I hope that is clear.

 

The user selects the skill and level from those lists, saves them, and closes the app. This information is stored in a separate table with user_email, skill_name, and experience_level. This view that you asked me to create is called the user_skills.

 

The objective is to use this view to populate the default selected items for every user who logs in: the skill_name in the Combobox, the text field of gallery(this happens automatically as it is linked to selected items in the Combobox), and the expertise_level in the dropdown of that gallery.

 

Is there a way to achieve this where the items and default selected items are coming from different sources?

 

I am able to set the default selected items of the Combobox from the view with a single column(skill_name) or multiple_columns(skill_name and expertise_level). I am only not able to apply the selected expertise_level to the default value of the dropdown in the gallery.

 

Please refer to the recent screenshots. They are much more clear. I really appreciate your patience on this!

 

 

Anonymous
Not applicable

@KroonOfficeSol 

 

Hey Paul,

New skills can be added or deleted only in the Combobox. The gallery just displays whatever skills are there in the Combobox. You can only select the expertise_level in the gallery

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

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