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
Super User
Super User

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
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Top Kudoed Authors
Users online (74,883)