cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SumanKoduri
Helper V
Helper V

How to display text values as dropdown in edit form

I've field as 0,1,2 

I added a drop down based on the field value i need to display as text

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @SumanKoduri ,

Do you want to display text in drop down based on the value of this field?

Could you tell me

1)what your data source is?

2)what data type of this field?

 

1)If it is number type, try this solution:

Step1: unlock this field in the form, delete the textinput in this data card, insert a drop down in the data card

Step2: set the drop down's Items:

 ["","Reg","Front"]

set the drop down's Default:

If(ThisItem.fieldname=0,"",ThisItem.fieldname=1,"Reg",ThisItem.fieldname=2,"Front")

set the datacard's Update:

If(drop down1.Selected.Value="",0,
   drop down1.Selected.Value="Reg",1,
   drop down1.Selected.Value="Front",2)

//please replace with the fieldname and drop down name

Then the drop down will display text based on this field value and update number based on the selected text value.

 

2)If it is number type in sharepoint list, try this solution:

Step1: unlock this field in the form, delete the textinput in this data card, insert a drop down in the data card

Step2: set the drop down's Items:

 

 ["","Reg","Front"]

 

set the drop down's Default:

 

If(ThisItem.fieldname.Value=0,"",ThisItem.fieldname.Value=1,"Reg",ThisItem.fieldname.Value=2,"Front")

 

set the datacard's Update:

 

If(drop down1.Selected.Value="",{Value:0},
   drop down1.Selected.Value="Reg",{Value:1},
   drop down1.Selected.Value="Front",{Value:2})

 

//please replace with the fieldname and drop down name

Then the drop down will display text based on this field value and update number based on the selected text value.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Pranav_Shroti
Kudo Collector
Kudo Collector

Since you have not shared much info, I would suggest you go through this link first - 

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/controls/control-drop-down

 

Regards,

Pranav

I've Status type values as 0,1 and 2 in db

But in edit form I want to display it as Reg for 1 and 2 for Front load with drop down and also based on db value it needs to display default value 

rebeccas
Community Champion
Community Champion

Need a little more detail to help on this but should be a simple if statement on the default of your drop down.

 

What allows you to select the 0,1,2? Radio button, drop down?

I have a field as Type in my table with value 0,1 and 2 like an enum.

So I added a drop down in my edit form 

So in Drop down i need to show values as "" for 0, Reg for 1 and Front load for 2

In default i need to show text based on value in my table like if table value is 2 i need to show front load in drop down and also other values 

 

Hi @SumanKoduri ,

Do you want to display text in drop down based on the value of this field?

Could you tell me

1)what your data source is?

2)what data type of this field?

 

1)If it is number type, try this solution:

Step1: unlock this field in the form, delete the textinput in this data card, insert a drop down in the data card

Step2: set the drop down's Items:

 ["","Reg","Front"]

set the drop down's Default:

If(ThisItem.fieldname=0,"",ThisItem.fieldname=1,"Reg",ThisItem.fieldname=2,"Front")

set the datacard's Update:

If(drop down1.Selected.Value="",0,
   drop down1.Selected.Value="Reg",1,
   drop down1.Selected.Value="Front",2)

//please replace with the fieldname and drop down name

Then the drop down will display text based on this field value and update number based on the selected text value.

 

2)If it is number type in sharepoint list, try this solution:

Step1: unlock this field in the form, delete the textinput in this data card, insert a drop down in the data card

Step2: set the drop down's Items:

 

 ["","Reg","Front"]

 

set the drop down's Default:

 

If(ThisItem.fieldname.Value=0,"",ThisItem.fieldname.Value=1,"Reg",ThisItem.fieldname.Value=2,"Front")

 

set the datacard's Update:

 

If(drop down1.Selected.Value="",{Value:0},
   drop down1.Selected.Value="Reg",{Value:1},
   drop down1.Selected.Value="Front",{Value:2})

 

//please replace with the fieldname and drop down name

Then the drop down will display text based on this field value and update number based on the selected text value.

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (3,465)