I can obtain a lookup result in a label when I use this formula:
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.Autonumber
)
But when I go one level deeper (as below), I receive no error messages, no red underlining, but the label remains empty
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.'OU Manager'.'Full Name'
)
Is there a way I can troubleshoot this & have PowerApps display the result value?
@mdevaney Does anyone have an idea why this is failing or how I can solve it?
I tried to get around these problems by setting two text labels within my form instead, the second of which referenced the first:
eg. a text label "labOU#" using the code Text =
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.Autonumber
)
Then I referenced this value from a second text label with the code Text =
LookUp(
'Operating Units',
Autonumber = 'labOU#'.Text,
'OU Manager'.cra6a_fullname
)
This worked... at least, it displayed correctly upon preview of the app (F5). However, when launching the app normally, not from edit view, the field renders blank.
Any hints how to solve what could be going wrong (with either this method or the one previously proposed)?
thx @mdevaney
I find this hard to understand. If I set the variable:
Set(
testVar,
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'
)
)
testVar shows a "record," and only the column "cr6a2_operatingunitid" has a value in it.
If I go a relationship level further in a different direction than my desired direction and set the variable:
Set(
testVar,
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.'OU Name'
)
)
Then testVar gives me a "text" output of the OU Name (great!).
However, when I go my desired direction and set the variable:
Set(
testVar,
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.'OU Manager'
)
)
testVar gives me a "record," only the entire record is blank (there are no columns).
I don't understand where I am going wrong. When I look at the underlying data for that OU (operating unit), the column 'OU Manager' is definitely populated (with a lookup field, so I would need to go one relationship level deeper yet). Why is LookUp() not pulling result data through the relationship levels?
And yes, for completeness, if I set the variable:
Set(
testVar,
LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.'OU Manager'.'Full Name'
)
)
testVar gives the "text" result of "No Value."
I can't see how I can be pulling the wrong relationship level results. Any help troubleshooting would be hugely appreciated!
You likely got no result because the column does not exist.
Just put this in the OnSelect of some random button. Then look for the result in the variables menu once you click the button. It’s the only way to explore the record.
Set(testVar, LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber
))
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."
Thanks so much @mdevaney
I put your code in the OnSelect of a button & pressed it, but I can't seem to get testVar to populate (under view->variables->global->testVar, it displays nothing, not even "no value."
As an alternate workaround, I took the output (within Label8) of the first code block I posted above (which works), and did a second Lookup() on it:
LookUp(
'Operating Units',
Autonumber = Label8.Text,
'OU Manager'.'Full Name'
)
And this correctly outputs the Full Name... Wouldn't this indicate that the values are indeed present?
Any help with troubleshooting this would be hugely appreciated.
@Medoomi
Set a variable like this...
Set(testVar, LookUp(
'OU Salesperson Lists',
Autonumber = DataCardValue12.Selected.Autonumber,
'OU #'.'OU Manager'
))
Then open the variables menu and inspect what's inside OU Manager. Perhaps there is no value there.
---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."