Hi All,
I would really appreciate any help because i really need to get this done.
I have two dropdown fields in PowerApps each pulling from a SharePoint list(mileage_distance). Both dropdowns store the same location and I want if a user selects a location in dropdown 1 and another location in dropdown 2, that a third field (text field) shows the distance between those two locations. The distance is also from the mileage_distance list
Please see attached milage_distance excel doc attached as well as a preview of my app.
Thanks for your assistance,
Alton
Solved! Go to Solution.
Hi @Altontait ,
You cannot do index type queries in Power Apps as you cannot dynamically reference field names - you cannot specify a field name (other than hard-coding it) from a drop-down value (which I assume you manually coded for the top row.
You would either need a table with two fields (place 1 and place 2) then specify each of the combinations of distances or hard-code the second drop-down results in the lookup
Switch(
dd.Selected.xxxx,
"CherryVille,
Cherryville",
"Harwood",
Harwood
. . . . .
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.
@Altontait So you are building a grid with n number of columns and n number of records in the SP List.
The Items Property of the 2 Dropdowns could just be hard coded as columns and rows are fixed (I assume).
Table({Location:"Board Office", "6 Mile",....})
The Text property of the Textinput would be (change control names as required),
Switch(dropdown1.Selected.Location,
"Board Office", LookUp(yourSPList, Title=dropdown2.Selected.Location).'Board Office',
"6 Mile", LookUp(yourSPList, Title=dropdown2.Selected.Location).'6 Mile',
.....
.....
)
@Altontait What are the column names and data type of the From Location, To Location and Distance columns in the SP List.
Hi @Altontait ,
You cannot do index type queries in Power Apps as you cannot dynamically reference field names - you cannot specify a field name (other than hard-coding it) from a drop-down value (which I assume you manually coded for the top row.
You would either need a table with two fields (place 1 and place 2) then specify each of the combinations of distances or hard-code the second drop-down results in the lookup
Switch(
dd.Selected.xxxx,
"CherryVille,
Cherryville",
"Harwood",
Harwood
. . . . .
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.
@Altontait So you are building a grid with n number of columns and n number of records in the SP List.
The Items Property of the 2 Dropdowns could just be hard coded as columns and rows are fixed (I assume).
Table({Location:"Board Office", "6 Mile",....})
The Text property of the Textinput would be (change control names as required),
Switch(dropdown1.Selected.Location,
"Board Office", LookUp(yourSPList, Title=dropdown2.Selected.Location).'Board Office',
"6 Mile", LookUp(yourSPList, Title=dropdown2.Selected.Location).'6 Mile',
.....
.....
)
As we have both advised, you will need to hard-code this in some form.
Hi @CNT @WarrenBelz,
I would like to thank you guys for your assistance with this and I did manage to hard code it and it's working perfectly now.
Thank you guys again.
User | Count |
---|---|
123 | |
87 | |
87 | |
75 | |
66 |
User | Count |
---|---|
215 | |
180 | |
136 | |
96 | |
83 |