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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to populate a fiel...
Power Apps
Answered

How to populate a field based on the values selected in 3 different fields ? (Matrix attached)

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

In my form I have 3 fields

  1. Site
  2. I work for
  3. I need help with

Site is picked up from User's details saved in Office 365

I work for has a dropdown to select from 5 values

I need help with a dropdown to select from 8 values

 

Based on the combination of the above 3 fields, the Coordinator's field needs to be auto-populated. Following is the matrix I have created. 

 

Screenshot (333).png

 

How to populate a field based on the values selected in 3 different fields? (Matrix above)

 

Regards,

Aakash

Categories:
I have the same question (0)
  • MarvinBangert Profile Picture
    1,924 Most Valuable Professional on at

    Hey @Anonymous 

     

    maybe you could use the if-function to achieve this, but it will be a huge if-function because you need to build every case.

    First, create an empty variable on app start:

    Set(CoordinatorValue;0)

    Then add a text input "txtSite", two dropdowns "drpWorkFor" and "drpNeedHelp" and a label to show your outcome "label1".

    Label1 Text is:

    "Value: " & CoordinatorValue

     

    drpWorkFor.OnChange is:

    If(
     txtSite.Text = "Location 1" && IsBlank(drpWorkFor.SelectedText.Value) && drpNeedHelp.SelectedText.Value = "Task 1";
     Set(CoordinatorValue;1);
     If(
     txtSite.Text <> "Location 1" && drpWorkFor.SelectedText.Value = "Division 1" && drpNeedHelp.SelectedText.Value = "Task 2";
     Set(CoordinatorValue;2);
     [...]
     )
    )

     

    When the user opens the app, the default "CoordinatorValue" is set to 0 (not assigned). When the user changes the need help dropdown, the CoordinatorValue will be updated.

    You can also use a collection at "on app start" to look up the values after they have been selected:

    Collect(
     Coordinators;
     {
     Value: 1;
     Name: "Person 1"
     };
     {
     Value: 2;
     Name: "Person 2"
     }
    )

     

    Label2 Text:

    "Person: " & LookUp(Coordinators;Value = CoordinatorValue;Name)

     

    Image 590.png

     

    Pretty much, but it should work. Hope this will help you!

     

    Regards,

    Marvin

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @MarvinBangert ,

     

    Thanks for your suggestion. However, I realized that this approach will not be very helpful if the values within the matrix are changing (new coordinators might get assigned or roles might change). To deal with this, I came up with an indigenous approach that is working well for me now.

     

    1. I populated the matrix and the coordinators' list in the form of table1 and table2 in an excel spreadsheet (saved on onedrive).Screenshot (365).png

     

    2. I used power query to unpivot the data in table1

    Screenshot (363).png

     

    3. I got table1 in a new layout which we can call as table_new

    Screenshot (364).png

     

    4. I loaded data from table_new to Powerapps. I also loaded data in table2 (Coordinators' list) to Powerapps

    5. I created a collection of table_new where I added an additional column which is a combination of columns 'Site', 'IWorkFor' and 'INeedHelpWith' (let's call it LookupField).

    6. In the same collection, I also added another column where I looked up coordinator's name from the Coordinators' list.

     

    //Create a collection of coordinator matrix
    ClearCollect(CoordinatorMatrixTemp,
    AddColumns(CoordinatorMatrix,
    "LookupField",Site &"-"& IWorkFor &"-"& Attribute,
    "Coordinator1",First(Filter(CoordinatorList,CoordinatorList[@Value] = CoordinatorMatrix[@Value])).Coordinator1,
    "Coordinator1Email",First(Filter(CoordinatorList,CoordinatorList[@Value] = CoordinatorMatrix[@Value])).Coordinator1Email,
     ));

     

     

    7. Now in my form, after a user has selected values in the 3 fields 'Site', 'IWorkFor' and 'INeedHelpWith', I concatenate these fields (LookupField) and lookup the respective Coordinator's name from the collection I created.

     

    If(RequestorSite_Input.Text <> "Kiel",
     LookUp(CoordinatorMatrixTemp,"Others" &"-"& IWorkFor_Input.Selected.IWorkFor &"-"& INeedHelpWith_Input.Selected.INeedHelpWith 
    in LookupField).Coordinator1,
     LookUp(CoordinatorMatrixTemp,"Kiel" &"--"& INeedHelpWith_Input.Selected.INeedHelpWith in LookupField).Coordinator1
    )

     

     

    Done. If there are any future changes in the matrix, the admin open the excel file, make the changes to the table and refresh the query and the changes will reflect in the app.

     

    Regards,

    Aakash

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard