cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

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 @Anonymous ,

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 @Anonymous ,

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?

 

Anonymous
Not applicable

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 @Anonymous ,

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.

 

 

Anonymous
Not applicable

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

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

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