Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the default value of a dropdown in powerapps

Tags:

powerapps

I have a dropdown in powerapps and need to set the default value

My Items property of my dropdown I have it linked to my data source which is an Azure table.

'[dbo].[ColorTable]'

One could see the contents simplified as the following

Table({ColorName:"red"; ID: "1"};{ColorName:"green"; ID: "2"}{ColorName:"blue"; ID: "3"})

although I have many more entries.

In my details edit screen I have the ID value in my main datasource. However I need to set the dropdown's default with this value, however the dropdown use the ColorName as it's value.

How do I set the dropdowns default ID value since its Value is ColorName and not ID?

like image 721
choba78 Avatar asked Oct 31 '25 07:10

choba78


1 Answers

I have a workaround that works but in conjunction with saving the selected value back again it can conflict with the saving.

In the Default property of the dropdown I add the following code

LookUp('[dbo].[ColorTable]';ID=ThisItem.fk_ColorID;ColorName)
like image 57
choba78 Avatar answered Nov 02 '25 23:11

choba78



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!