4

I stumbled across Microsoft PowerApps earlier, and though I would have a play with it. I have connected to my SQL Server, and created a template for browsing, viewing and editing a basic application. Now in my database I have the following relationship:

enter image description here

On the add/edit screen this asks the user to enter the "CustomerID". I want to be able to use a drop down menu to search the list of customers.

So far I have:

  1. Added an additional Datasorce to my table "Customers"
  2. Changed the control from a text box to a drop down menu

enter image description here

it is at this stage I am stuck and unsure of how to progress further. Currently when debugging, the list shows nothing, nor appears to be searchable.

Crezzer7
  • 2,265
  • 6
  • 32
  • 63

2 Answers2

5

This is how you do it...

First put the tableName and columnName(the one that you want to display) in the DATA field of DataCardValueX. Refer the image below. Here I am putting ProjectName field of ProjectData table for display.

image1

Now go to its parent DataCardX, go to DATA and change the Update field to DataCardValueX.Selected.ColumnName (the one that you want to use to get actual ID value). Refer the image below. Here I am putting ID field of my ProjectData table to get the actual id value from.

image2

Thats It. Now you can select the name and have the actual value assigned to the form.

Harshil Patel
  • 51
  • 1
  • 2
4

I found out how to do it! (with a different example, however the same thing required)

after the 2nd stage above, scroll down until you see the DataCardValue[number].value. its here that you can enter the alternative data source and populate the drop down list with the value you want. This automatically references the ID's and the correct options are shown:

enter image description here

Crezzer7
  • 2,265
  • 6
  • 32
  • 63
  • 2
    So, if you put `BuildingName` in the `value` field as shown in your answer, how might you ensure that OnSelect action assigns `BuidingId` onto the entity being edited. In other words, display something pretty in the menu, but, use the corresponding ID – bkwdesign Jan 17 '18 at 05:05