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

Community site session details

Session Id :
Power Apps - Building Power Apps
Unanswered

Drop Down for Database field

(0) ShareShare
ReportReport
Posted on by 60

Hi all!

 

I have a nvarchar(50) field in my mssql table.

until now I created a edit form and placed this field on it. now I just have a text box:

1.png

 

Now I want to achieve this:

 

I want to set some predefined values in a dop down box as suggestion for the user. for example a drop down box that has the predefined values:

- Gate 1

- Gate 2

- No Gate

 

This values dont has to come from a database table. They are not dynamically so I just want to do it by "hard coding".

 

But I also want that the user can insert a custom text!!!

 

please help

thanks

jup

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    on at
    Re: Drop Down for Database field

    Hi @jup,

     

    I made some tests for your problem
    Soooo...
    In a SharePoint List I created a String Column called "TextTest"

    I created then a PowerApp with gallery, details and edit forms.
    Il replaced the TextBox dedicated to my column "TextTest" with a ComboBox 1.

     

    Here are the statements of my ComboBox :

    SelectMultiple : false

    IsSearchable : true

    Items : ["Gate 1";"Gate 2";"No Gate"]

     

    Here is the statement of my TextTest column Card :

    Update : If(CountRows(ComboBox1.SelectedItems) = 0;
    ComboBox1.SearchText;
    First(ComboBox1.SelectedItems).Value)

     

    Here is the statement of my Edit View :

    OnVisible : Reset(ComboBox1)

     

    Like that, the user can choose a field in the list but if he wants an other value, he writes it in the SearchItem section.

     

    Best regards,

     

    Louis

  • v-monli-msft Profile Picture
    on at
    Re: Drop Down for Database field

    Hi @jup ,

     

    Would you please explain more about how you want to achieve this? For example, did you mean that only when user pick the "No Gate" inside the dropdown control that they want to fill the value inside the textinput control? 

     

    If so, then please try to follow below steps to achieve this:

    1. Unlock the data card of this field inside the edit form. With the data card selected, insert the Dropdown control and set its Items property to:

    ["Gate 1","Gate 2","No Gate"]

    2. Insert a textinput control.

    3. Set below formula in the Update property of the data card:

    If(Dropdown1.Selected.Value="No Gate",TextInput1.Text,Dropdown1.Selected.Value)

    Regards,

    Mona

  • Community Power Platform Member Profile Picture
    on at
    Re: Drop Down for Database field

    Yes,

     

    We have closely the same answer @v-monli-msft.

     

    You have 2 different ways now @jup 

     

    Regards,

     

    Louis

  • jup Profile Picture
    60 on at
    Re: Drop Down for Database field

    Hi !

    I want to use louis' solution.

     

    If I do so as explained, I'll get an error- see images attached.

     

    Thanks

    jup

     

  • Community Power Platform Member Profile Picture
    on at
    Re: Drop Down for Database field

    Can you share to me your full formula screen to locate the error ? 
    I confess I don't find your problem...

     

    Regards, 

     

    Louis

  • jup Profile Picture
    60 on at
    Re: Drop Down for Database field

    please find attached 🙂

  • Community Power Platform Member Profile Picture
    on at
    Re: Drop Down for Database field

    I mean that type of screen to locate the error in the function 🙂

     

    Capture5.PNG

  • jup Profile Picture
    60 on at
    Re: Drop Down for Database field

    see attached 🙂

  • jup Profile Picture
    60 on at
    Re: Drop Down for Database field

    and here

  • Community Power Platform Member Profile Picture
    on at
    Re: Drop Down for Database field

    Ok I see, I think I had the same error...

     

    Try to erase the ".Value" at the end of the function, you put a "." and you take the first given proposition

     

    Keep me informed 🙂

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Chiara Carbone – Community Spotlight

We are honored to recognize Chiara Carbone as our Community Spotlight for November…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 663 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 398 Super User 2025 Season 2

#3
developerAJ Profile Picture

developerAJ 235

Last 30 days Overall leaderboard