cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sasrsc
Resolver II
Resolver II

Default Dropdown Value

I have a dropdown object on my canvas app. The items value is...

SortByColumns(ShowColumns(Filter(EventStatus,Title="HotelStatus"),"Order0","StoredValue","DisplayedValue"),"Order0",Ascending)

The default value is...

LookUp(Attendee,ID=selectedAttendeeID,HotelStatus)

While there is no error that is not actually what I want. 
My SP List "Event Status" has a stored value and a displayed value.

I am storing in the Attendee SP List the "stored value" but of course the person sees the "displayed value".
How do I get the default to match on the "stored value" yet display the "displayed value".
Right now, it's matching on the "displayed value" only.

1 ACCEPTED SOLUTION

Accepted Solutions

Here's the final and working version for anyone to see...
Yes, Fabian you were 100% correct with what I wanted.

LookUp(EventStatus,'Stored Value'=LookUp(Attendee,ID=selectedAttendeeID,HotelStatus),'Displayed Value')

De-structuring this...
Table 1=EventStatus and that contains the values I want in the dropdown list (for people to chose from) ... 
They see the "DisplayedValue" in the dropdown list and what they select behind the scenes is the "StoredValue".
Table 2=Attendee - that contains the stored value in a column call HotelStatus.

In your example: "hello1" is stored in the attendee list in hotelstatus, but they see "world1" in the dropdown.

I did have to tweak your code slightly but thank you lots. I was doing it backwards...!!!

View solution in original post

4 REPLIES 4
FabianAckeret
Super User
Super User

Hi @sasrsc 

 

Are you using a SharePoint form to update your list? If so, you might want to click on the datacard including that dropdown and check the Update property. Make sure that this Update property refers to the right column in your dropdown.

 

If this is not what you're looking for, could you provide some more information? Perhaps some screenshots as well.

 

Thanks and kind regards,

 


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

This is not within a form object. It's a dropdown object directly on the canvas. Sorry I probably should have said that. All my data sources are SP Lists...
The SP list containing all the values for the dropdown is like this..

OrderStoredValueDisplayedValue
1LLWaitlist

 

The SP List where the data for each attendee is stored has a hotelStatus variable and that stores "LL" but the user sees "Waitlist". Does that help?

FabianAckeret
Super User
Super User

Hi @sasrsc 

 

Not sure if I got it correctly.

Let me write what I understood and you just correct me if I'm wrong.

 

You have two SharePoint lists that you store items as follows:

EventStatus

Title Order0 StoredValue DisplayedValue
HotelStatus 1 hello1 world1

 

Attendee

ID Title HotelStatus
1 testrow1 hello1

 

In your Power Apps, you would like to create a dropdown including all values from EventStatus. This dropdown should display the DisplayedValue from the list EventStatus.

 

The default value of that dropdown should match what is saved in the Attendee list. Say, when a user has saved hello1, the dropdown should show world1, correct?

 

If so, how do you match the current User with the entry? I've seen that in your initial post you're matching something with the ID of the SharePoint list, so I just tried to put together something that could maybe work, but probably needs tweaking:

// Default for dropdown
LookUp(EventStatus, StoredValue = LookUp(Attendee,ID = selectedAttendeeID).HotelStatus)

 

I hope this helps.

 


Please click Accept as Solution if my post answered your question. Like my answer? Consider giving it a Thumbs Up. Others seeking the same answers will be happy you did.

Here's the final and working version for anyone to see...
Yes, Fabian you were 100% correct with what I wanted.

LookUp(EventStatus,'Stored Value'=LookUp(Attendee,ID=selectedAttendeeID,HotelStatus),'Displayed Value')

De-structuring this...
Table 1=EventStatus and that contains the values I want in the dropdown list (for people to chose from) ... 
They see the "DisplayedValue" in the dropdown list and what they select behind the scenes is the "StoredValue".
Table 2=Attendee - that contains the stored value in a column call HotelStatus.

In your example: "hello1" is stored in the attendee list in hotelstatus, but they see "world1" in the dropdown.

I did have to tweak your code slightly but thank you lots. I was doing it backwards...!!!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

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