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 / Populate a dropdown bo...
Power Apps
Answered

Populate a dropdown box or set buttons actions based upon a filtering condition related to the user identity

(0) ShareShare
ReportReport
Posted on by 124

Good morning, I'm really a newbie with powerapps and I'm getting crazy with FX syntax.

I'm more a powershell user and often I try to perform actions following a PS logic but this doesn't works fine with Power Apps.

I need the develop an app that interact with a sharepoint list, it create a new row with the selected answers to the dropdown boxes and text inputs fullfilled by the user.

 

I need to populate some of the dropboxes based upon some conditions such as the user identity.

 

I have several columns but I will reduce to the minimum the fields for the example because when I will identify the correct syntax it would be used for each other column

 

I have the following SP list:

 

Cars:

Title(licenseplate)IsActiveUserDoneModelDateKM
text typechoice typeLookUp(Users.Title)yes/no typetext typedate typenumber type

 

Users:

Title(email)Display Name
text typetext

 

each user have one or more cars assigned to him, each car can be assigned to one user only.

each car have an "isactive" choice field that can be set as "active/pause/dismissed"

each car have a "done" yes/no field

 

for the user identity I thought to use "Office365Users.MyProfile().mail" property

 

my first need is button  with that kind of logic:

if there is at least one car assigned to the user connected to the app that have the field "isactive" to "ACTIVE" and field "Done" in "NO" state, app will navigate to screen1 otherwise app will navigate to screen4

 

this because if the car is in "pause" or "dismissed" user don't have to do anything and goes to the last screen, for the "active" cars if the "Done" is in "NO" state user need to perform an action otherwise app will go straight to last screen.

 

 

My second need is a dropdownbox populated with all the license plate assigned to the user that are both isactive.Active and Done.NO

 

that's because user will perform an action one licenseplate at the time, when done, the connected flow or the app itself will change state to the "Done" field from "No" to "Yes" and then if there are more licenseplate assigned to the user, the app will go back to  screen1 and the dropdownbox have to be populated with all the licenseplate that are still isactive.Active and Done.NO

 

my third need is the following: when user select a licenseplate isactive.Active and Done.NO and press a button to navigate to the next screen, the app will then display a list of dropdownboxes and textboxes with questions, some pre-filled for example a textinput "last_maintenance" will have the default value cars.date related to the selected cars.licenseplate (from the dropdownbox in the previous screen), user may change it or not (if changed this will update the sp list field too)

the same for a text box "Last_Maintenance_Km"

 

I can't find a way to query for cars data related to the user identity and then query for cars data related to the licenseplate.

 

in powershell probably I would use variables to collect the whole SP lists (if you think about the SPList as csv file for example, or an xml file or a json or whatever with navigable properties ) then use foreach cycles comparing user identity and car.user and then an if statement with the double condition in "and" to check isactive and done, then I will set a varible to proceed or not etc etc but I can't find a way with power app.. 

 

I'm sorry if my questions sounds silly but I'm trying filter,distinct and sort without any result since this monday and I was able to perform very few progress.

 

Thanks for your help

Categories:
I have the same question (0)
  • Verified answer
    DPozzi Profile Picture
    124 on at

    I've changed the DONE column from yes/no type to CHOICE type in the SPList

     

    I've made a dropdown box with the following:

     

    SortByColumns(
    Distinct(
    Filter(
    Cars,
    User.Value=varUser && isActive.Value="Active" && Done.Value="NOT DONE"),
    Title
    ),
    "Result"
    )

     

    I've declared a variable varUser in the "OnVisible" of the screen in that way Set(varUser,Office365Users.MyProfile().Mail); because otherwise I wasn't able to make to control work, due the date type I guess "TABLE" vs "TEXT" where "TEXT" is needed.

     

    This works fine with dropdown and list but for example I can't use this syntax with Labels.TEXT, any suggestions to convert table type to text? I've read something about CONCAT but I don't have other values to concat with.

  • DPozzi Profile Picture
    124 on at

    I did it in that way

     

    if I have a pure label text with a different info (not the license plate)

    I concat with "" the value of sortbycolumns formula based upon the previous screen dropbox (selLicensePlate)

     

    Concat((SortByColumns(
    Distinct(
    Filter(
    Cars,
    Title=SelLicensePlate.Selected.Result),
    Model
    ),
    "Result"
    )), Result & "")

     

     

    if instead I have to use the licenseplate value directly I use SelLicensePlate.Selected.Result

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @DPozzi ,

     

    Please consider accept the replies as the solution.

     

    Best regards,

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard