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 / replace text fields wi...
Power Apps
Answered

replace text fields with dropdowns and/or comboboxes

(0) ShareShare
ReportReport
Posted on by 124

hello all!

 

This one should be fairly easy, and I have seen it done before, but for the life of me, I cannot figure out where I am going wrong.  I have a new app, that is using the form control and is populated with not only the main sharepoint list (which gives me all of my fields) but also sub-sites that contain pre-made lists that I want to use to populate the dropdowns.

 

I have my fields (below) and I want to now delete (or change) them with the sub-lists.  Where do i change things?

 

davyjones_2-1663091799702.png

 

davyjones_1-1663091710234.png

 

 

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @davyjones 

    In your form, edit the fields.  If you have NOT unlocked the datacard for the fields you want to change to dropdowns, click on the field in the edit fields list and change the Control Type to Allowed values.

    If you have already unlocked the datacard, then remove the field from your form and add it back in and then change the control type.

     

    Then, in the AllowedValues property of the datacard (this will only appear once you have changed to an Allowed Values control type), set your formula to get the items you want.  You will provide a single column table of Value columns.  So rename the column that you want to be the value.

    For example:  

    RenameColumns(yourList, "system", "Value")

     

    All the rest will be done for you (in regard to updating and re-displaying values).

     

    I hope this is helpful for you.

  • davyjones Profile Picture
    124 on at

    okay!  no red x's on that, so things appear to be okay.  Not sure how to test it, as I am only now putting the form together.  As you can see from the below, I have updated the code as you have suggested.  Now comes the harder part.  Depending on what they pick in the first dropdown, it will affect what is in the second dropdown, as you can see from the same sub-list.  Suggestions?

     

    davyjones_0-1663093130022.png

    davyjones_1-1663093187455.png

    davyjones_2-1663093228740.png

     

     

     

     

  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @davyjones 

    The easiest thing to do is to change your AllowedValues formula on the system dropdown to:

    RenameColumns(
     GroupBy('CV&S BRT_System_Module', 
     "system", "_modules"
     ),
     "system", "Value"
    )

     

    Then on the Modules dropdown AllowedValues property, set the formula to:

    RenameColumns(yourSystemDropdownControlNameHere.Selected._modules, "Module", "Value")

     

    That would provide what you are looking for.

  • davyjones Profile Picture
    124 on at

    Okay, so far so good!  I do appreciate all of your help!

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @davyjones 

    Happy to help!

  • davyjones Profile Picture
    124 on at

    Maybe I have the syntax wrong, but I tried to replicate your solution with another group of dropdowns:

    Region and Country.  I am getting red x's on both boxes, even though I used the same syntax as before, just changing the names.

     

     davyjones_2-1663100819435.png

     

    davyjones_0-1663100741811.png

    davyjones_4-1663100909675.png

     

     

  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @davyjones 
    When you group by, the first parameter is your source table.  The second to x-1 parameters are the fields you want to group on.  In your case, only one - "Region".  The last parameter is the name of the column you want to create in your result table that will contain all the records that match the group criteria.  So, in your case, the _country column will contain all the records that match a distinct Region.  It would be 1 to x number of records in that _country table.

     

    SO..,.you don't want to rename the _country column as it will be a table.  It is the column of that table that you want to rename.

    Your allowed values would specify the table of Value records you want.  

     

    Anyway, your formula on the first Allowed Values property is good.

    The second one should be:

    RenameColumns(DrpRegion.Selected._country, "<nameOfColumnYouWantInYourListHere>", "Value")
  • davyjones Profile Picture
    124 on at

    Thank you for the continued assistance!  However, even though you said that the first bit of code is okay, I am still getting red x's on that one, and I changed the second to what you see below (because 'Region' goes with 'Country') and I am still a red X on that one too.  

     

    davyjones_0-1663156926296.png

     

  • davyjones Profile Picture
    124 on at

    Good morning, @RandyHayes !!

     

    Just wanted to say that I have been using your 'splitting forms' view, and it works great with the newest app that I am building, so thank you so very much!

     

    However, your solution for the dropdowns not only is still giving me red x's on most of the fields, but the ones that it doesnt dont give me any information when i click on the arrow.  Like, its just not doing anything.  am i doing this wrong?

     

    Thank you,


    Dave

  • davyjones Profile Picture
    124 on at

    I think that I found the issue.  The first column in both SharePoint lists is still under the 'title' column (even though its named differently elsewhere), so when I used that in the code you suggested, it all works now!

     

    While I have you, how can the default be a 'blank' choice?

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 401 Most Valuable Professional

#2
11manish Profile Picture

11manish 201 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard