I'm rather new to PowerApps so please bear with me! 🙂
I'm making an Inward goods and package delivery tracker app and I until now have been using Lookup comfortably on my SharePoint data cards within an editform.
Currently, I can pick an address within my "Stores Daily Package Tracker" SharePoint list which has Lookup on the "ADDRESS/DEPT" column to a separate list called "Personnel List" which will grab the corresponding Area to fill in the defaultselecteditems of my Area datacard.
While the Area and Description/Notes boxes can be populated from lookups, my Address Field struggles with the Name field (all pulled from the same lists). It gives me the error "Expected Table Value". I have tried playing with the column types to try to negate this but it seems to be more within PowerApps.
For reference, my code is as follows:
Name Field OnChange property:
Set(varName,DataCardValue15.Selected.Value)
Name Field Items property:
Choices([@'Stores Daily Package Tracker'].NAME)
Address Field Items property:
Choices([@'Stores Daily Package Tracker'].'ADDRESS/DEPT')
Address Field DefaultSelectedItems property (the one with the error):
LookUp('Personnel List',NAME=varName).ADDRESS
Screenshots attached. Any guidance here would be greatly appreciated!
Solved! Go to Solution.
The error is because the DefaultSelectedItems must be a record from the table that is used for the Items property of the Address ComboBox. You are just using some TEXT and not a RECORD ... if that makes sense.
You could try:
// Address Field DefaultSelectedItems property
Lookup(
Choices([@'Stores Daily Package Tracker'].'ADDRESS/DEPT'),
Value = LookUp('Personnel List',NAME=varName).ADDRESS
)
If that doesn't work, you could try setting another variable in the OnChange of the Name field, then the above would look like
// Name Field OnChange property
Set(varName,DataCardValue15.Selected.Value)
Set(varAddress,LookUp('Personnel List',NAME=varName).ADDRESS)
// Address Field DefaultSelectedItems property
Lookup(
Choices([@'Stores Daily Package Tracker'].'ADDRESS/DEPT'),
Value = varAddress
)
The error is because the DefaultSelectedItems must be a record from the table that is used for the Items property of the Address ComboBox. You are just using some TEXT and not a RECORD ... if that makes sense.
You could try:
// Address Field DefaultSelectedItems property
Lookup(
Choices([@'Stores Daily Package Tracker'].'ADDRESS/DEPT'),
Value = LookUp('Personnel List',NAME=varName).ADDRESS
)
If that doesn't work, you could try setting another variable in the OnChange of the Name field, then the above would look like
// Name Field OnChange property
Set(varName,DataCardValue15.Selected.Value)
Set(varAddress,LookUp('Personnel List',NAME=varName).ADDRESS)
// Address Field DefaultSelectedItems property
Lookup(
Choices([@'Stores Daily Package Tracker'].'ADDRESS/DEPT'),
Value = varAddress
)
@EddieE thank you so much for the explanation, the first code suggestion worked after I removed using variables in the lookup and instead just used the DataCardValue15.Selected.Value as the condition of the lookup instead:
LookUp(Choices([@'Stores Daily Package Tracker'].'ADDRESS/DEPT'), Value = LookUp('Personnel List',NAME = DataCardValue15.Selected.Value).ADDRESS)