web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Apps
Unanswered

Combo box

(0) ShareShare
ReportReport
Posted on by 23

Hello,

I'm novice to power apps. Here's the scenarios . . .

  1. I have two SharePoint lists/tables:
    • Student_List (with Student ID field as primary key - data type "Number"; Firstname, Lastname)
    • Class_List ( with Student ID field as secondary key - data type "Number")
  2. In the power apps,  I created a Class_List Form based on Class_List table data source
    • I'd like to have a COMBO BOX to show the (Student ID, Firstname, Lastname) from Student_List table data source
    • I want the value Student ID in the Combo Box to be stored in the Class_List field Student ID (secondary key)
  3. Kindly help me how to achieve the above requirements in a step-by-step process.

Thank you so much in advance.

Dave

Categories:
I have the same question (0)
  • Verified answer
    NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi,
    You can follow below steps: 
    1. Add a form with Class_List as a data source.
    2. In that form, unlock changes to Student ID DataCard.
    3. After unlocking changes, you will be able to add input fields. Now you can add combobox to this data Card. Set the visible property of Student ID to false.
    4. To achieve the functionality there are 2 ways

    A. OOB way to Set the items property of combobox to Student_List and then modifying the Fields property that is visible on the right side to have "Double layout". Double layout can display 2 fields (ID and FirstName/LastName from Student_List). To save ID in ClassList, set Update property of DataCard Student ID to ComboBox1.Selected.<StudentIDColumnName>
    B. There is another way where you can create a collection on screen visible property:
    ClearCollect(comboStudentList, AddColumns(Student_List,"ID+FirstName+LastName", Concatenate(StudentID, " - ", 'First Name', " - ", 'Last Name') ) ). After creating a collection, set items property of combobox to comboStudentList.ID+FirstName+LastName. To save the ID in ClassList, you will have to add below formula on Update property of Combobox added First(Split(ComboBox1.Selected.'ID+FirstName+LastName',"-")).Result

  • davealejo Profile Picture
    23 on at

    Hi,

    Thanks for your quick response.

    1. I tried first your solution (B), but I'm getting error as shown below in attached file "01 ClearCollect". Is "comboStudentList" acts like a global variable? This seems to be acting as data source for ComboBox1.
    2. The second error (pls refer to "02 ComboBox" and "03 Student Datacard error")
    3. Please note the actual SharePoint list names are: (1) "Caregroup Database" for <<Student List>>; "(2) "Caregroup Batch" for <<Class List>>. In my context there is no defined "Table/List relational database" linking between these two SharePoint lists.
    4. I will also let you know later how your solution (A) works.

    I hope you can understand my language (i.e., narration of the problems) and help me fix (my) errors. 🙂

    Thank you

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @davealejo ,

    Thanks for trying 🙂
    Can you please let me know the columns names used to capture FirstName and LastName in 'Caregroup Database' so we can resolve the first ClearCollect issue.

  • davealejo Profile Picture
    23 on at

    Hi @NandiniBhagya20 attached is the database structure. 

    Thank you for your patience!

  • NandiniBhagya20 Profile Picture
    4,667 Super User 2024 Season 1 on at

    Hi @davealejo,
    Is 'Caregroup Database' a list in SharePoint ?
    I guess the issue is related to naming of columns in ClearCollect error. Could you please let me the error text which you are getting.
    Is option A working ?

  • davealejo Profile Picture
    23 on at

    Hi @NandiniBhagya20 ,

    • Sorry for confusing you, all the tables or list are SharePoint lists.
    • It seems no error now showing on the ClearCollect
    • The errors still appears in the StudentID DataCard and ComboBox1 respectively (pls see attachments)
  • Verified answer
    davealejo Profile Picture
    23 on at

    Also, The BatchForm1 property Default Mode is set to "Edit" and when I run the Preview it returns "No Item to Display"

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard