cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kaswiere
Microsoft
Microsoft

Implementing Multi Select List Box From Sql

I want to create a Power Apps form with a sql database where the form allows a user to enter skills for an employee.  The employee can have multiple skills.  So, I have three tables an employee, skills and employeeskills table.  What do I need to do to get the mulitselect skills field working?  Is there a way to do a multiple lookup where I lookup the skills in the employeeskills table and then lookup the specific skill in the skills table?

4 REPLIES 4
eka24
Super User
Super User

That is doable with LookUp function.

Can you give some sample to help the process?

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

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.

Please Subscribe to my Youtube Channel

 

I have an employee table with the rows

 

EmpIdFirstNameLastNameEmpSkillId
1TimSmith25
2DaveJones35

 

An employee can have multiple skills.  The employees table has a EmpSkillId columns which references the EmpSkill table.

 

Here is the EmpSkill Table

 

IdSkillId
252
254
255
353
355

 

The EmpSkill table has a reference to Skill Id which references a specific skill

SkillIdSkill
1Excel
2PowerPoint
3Windows
4Linux
5Mac

 

So in my Power App I need to join the employees table with the EmpSkill table to get all the skills for an employee and then join the Skill table to get the specific skill.

 

 

eka24
Super User
Super User

Consider this:

With(
    {
        NewEmployee: AddColumns(
            employees,
            "SkillID",
            LookUp(
                EmpSkill,
                Id = employees[@EmpSkillId],
                SkillId
            )
        )
    },
    AddColumns(
        NewEmployee,
        "Skill",
        LookUp(
            EmpSkillSpecific,
            SkillId = NewEmployee[@SkillID] * 1,
            Skill
        )
    )
)

 

eka24_0-1632589446048.png

 

-----------

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.

Please Subscribe to my Youtube Channel

 

Thanks for your help so far.  It is much appreciated.  I think we are close.  However, it is only returning one skill per employee.  If an employee has multiple skills, it is not returning multiple it is only returning one.

 

I tried using a Filter instead a lookup on the EmpSkill table.  If I do that the SkillId column is a table and the second lookup doesn't work.  Do you think I need to use a ForAll loop?

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,497)