Hi,
using the field Type DataCardValue in a existing app. But how i could define a default value for this? All inserts i try are not accepted.... A Howto by GUI or Code is interesting.
Solved! Go to Solution.
Hi @MD2409_ ,
I did a test for you.
I have a yes/no column in dataverse.
This is my combo box Items property :
Choices(TestL12.Test_Yes_No)
//TestL12 is the name of my table
Set combo box control's DefaultSelectedItems property to:
LookUp(Choices(TestL12.Test_Yes_No),Value='Test_Yes_No (TestL12)'.Yes)
Best Regards,
Wearsky
Hi @MD2409_
This appears to be a combobox control - should be at the top of the properties pane you have shown in your post. A combobox uses a table for its items and the selection is a record from that table.
'Datacardvalue' is a name that Power Apps automatically assigns to controls (in this case a combobox) within 'datacards', within a form.
What type of column is this combobox connected to? - Assuming it is a choice field?
The 'defaultselecteditems' in the datacardvalue should be 'ThisItem.YourColumnName'.
For info - by default, when you set up a form, it will show the following in 'defaultselecteditems' for the control (i.e. datacardvalue): 'Parent.Default'. By this, it is referring to the parent control, the datacard that it sits within and then the default property of the datacard is 'ThisItem.YourColumnName'. This has the same result and displays the current item for this field from your backend data.
If there is any doubt, the easiest thing to do if you are not doing anything too specific is to remove this field from the form, then simply re-add it. This will reset the Datacard and controls within back to their default code.
Hope this helps - Good Luck
Thx for your feedback, but it sound a bit complicated.
Id just like to know, what i need to insert in this field to set the default value for this field?
The options are Yes or No for this field but the system do not accept this in any way i try...
Set the DefaultSelectedItems:
["Yes"]
Hi @MD2409_
It depends what you want your default to be:
Hi,
the actual accpeted value is ThisItem.YourColumnName when i change it to ["yes"] i got again a error message.
The field behind in dataverse is a Yes /No Boolean column.
Hi @MD2409_
Glad that worked out for you. Yes a Boolean will not accept ["yes"].
If my posts helped you, please consider accepting as a solution.
Many thanks and good luck with the rest of your build
???
As mentioned it does not work as recommendet !
Hi @MD2409_ ,
I did a test for you.
I have a yes/no column in dataverse.
This is my combo box Items property :
Choices(TestL12.Test_Yes_No)
//TestL12 is the name of my table
Set combo box control's DefaultSelectedItems property to:
LookUp(Choices(TestL12.Test_Yes_No),Value='Test_Yes_No (TestL12)'.Yes)
Best Regards,
Wearsky
User | Count |
---|---|
121 | |
88 | |
88 | |
75 | |
66 |
User | Count |
---|---|
216 | |
180 | |
138 | |
96 | |
80 |