cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Andrew-Samuel
Frequent Visitor

Dropdown Default With Manual Items

I have a dropdown and I've set the Items to the following:

 

 

 

Table(
    {
        Text: "Can manage unaided",
        Val: 0
    },
    {
        Text: "Uses an aid",
        Val: 1
    },
    {
        Text: "Requires assistance of 1 carer for all transfers",
        Val: 2
    },
    {
        Text: "Requires assistance of 2 carers for all transfers",
        Val: 3
    },
    {
        Text: "Bedfast/Chairbound",
        Val: 4
    }
)

 

 

 

I've set the form card's Update value to "DataCardValue.Selected.Val" so I only save the value into the SharePoint list.

 

When I reload the form, if I set the dropdown value to "Text" - it doesn't show to associated text.

Andrew-Samuel_0-1620400898771.pngAndrew-Samuel_1-1620400923658.png

 

If I change the dropdown Value attribute to "Val", it shows the value saved in the SharePoint list - but the dropdown displays the Val and not the Text.

Andrew-Samuel_2-1620400957086.pngAndrew-Samuel_3-1620400969103.png

 

How do I set the dropdown's selected item to be the items Val but show the items Text? (if that makes sense?!)

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Andrew-Samuel ,

You need to save the second value in another field - you can hide it if you want. You can set the Default of that control to the value. The number is the one best for this as you want to show the text.

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

View solution in original post

4 REPLIES 4
WarrenBelz
Super User
Super User

Hi @Andrew-Samuel ,

Firstly, Text is a very bad name for a field as it is a Reserved Word in Power Apps and I suggest you change it.

I am not totally sure on your requirements here, but if you save only the Value, it cannot possibly show the Text as the Default as it does not exist in the target field.

Have I misunderstood something?

 

Hi Warren,

 

Thanks for replying... firstly, I totally take your point about the name Text as a field... that's just me being stupid!

 

Basically, I have about 12 of these dropdown boxes. Each item in the dropdown has an associated value and I have another field which is calculating a total of these 12 dropdowns.

 

I need the user to see the text and I need to add up the total from all the dropdowns. I also need to recall the values if the user needs to go back in and make a change. I'm not really sure how to achieve this with PowerApps. I did try using a collection, but that didn't work either (though that may just be because I didn't do it correctly).

 

I'm, basically, looking for a key and value pair - but I'm struggling here!

Hi @Andrew-Samuel ,

You need to save the second value in another field - you can hide it if you want. You can set the Default of that control to the value. The number is the one best for this as you want to show the text.

 

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

 

 

View solution in original post

Okay... took me a while to work it out, but I got there.... thank you for your help!

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,219)