cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
PeKa6
Level: Powered On

No result from LookUp (Or error message)

Hello!

I am quite new to PowerApps, so bear with me.

I am working on a simple app to manually input values to a database. In order to determine if the value is plausible I want to display the value of the previous day and the difference in edit mode. I am using the standard template for making a database app.

I am using a LookUp formula that looks like this (In edit mode): 

LookUp('[dbo].[RonderingKVV1]';RondDate = PrevRondDate;Råvatten)

RonderingKVV1 is my SQL table.
RondDate is a date data type.

PrevRondDate is a date datatype that is computed as (dateadd(day,(-1),[RondDate])) in the SQL table. I was going with RondDate - 1 to begin with but changed it during troubleshooting.

Råvatten is a float datatype.

 

If I try changing the forumla to look at the primary key 

LookUp('[dbo].[RonderingKVV1]';IDKey = 1;Råvatten)

it returns the value so I'm guessing I've done something weird with the dates.

I don't get any error messages or warning, just a blank label.

I've been pulling my hair over this for the better part of the day, so any help would be greatly appreciated!

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: No result from LookUp (Or error message)

HI @PeKa6 ,

Could you please share a bit more about the PrevRondDate in your SQL table? Is it also a Date type column in your SQL Table?

 

I assume that the PrevRondDate that you mentioned is also a Date type column in your SQL Table, is it true?

Based on the formula that you provided, I think you have some misunderstanding on the Filter functions (e.g. LookUp, Filter, Search) in PowerApps.

 

When using Filter functions (e.g. LookUp function) in PowerApps app, the second argument of it is required to provide a condition formula. In default. the left side of the condition formula should be a column name, the right side of the condition formula should be a specific value rather than a column name:

LookUp('Data Source', ColumnName = "A specific value")

E.G.

LookUp('[dbo].[RonderingKVV1]'; RondDate = DateValue("04/05/2019"); Råvatten)  

 

As an fixed solution, I have made a test on my side, please take a try to modify your formula as below:

LookUp(
'[dbo].[RonderingKVV1]';
RondDate = DateAdd(ThisItem.RondDate, -1, Days); /* <-- The DateAdd() function is used to calculate the previous day value of the RondDate value of current item */
Råvatten
)

Or

LookUp(
'[dbo].[RonderingKVV1]';
RondDate = DateAdd(ThisItem.RondDate, -1, Days) /* <-- The DateAdd() function is used to calculate the previous day value of the RondDate value of current item */
).Råvatten

More details about the DateAdd function, please check the following article:

DateAdd function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
3 REPLIES 3
Community Support Team
Community Support Team

Re: No result from LookUp (Or error message)

HI @PeKa6 ,

Could you please share a bit more about the PrevRondDate in your SQL table? Is it also a Date type column in your SQL Table?

 

I assume that the PrevRondDate that you mentioned is also a Date type column in your SQL Table, is it true?

Based on the formula that you provided, I think you have some misunderstanding on the Filter functions (e.g. LookUp, Filter, Search) in PowerApps.

 

When using Filter functions (e.g. LookUp function) in PowerApps app, the second argument of it is required to provide a condition formula. In default. the left side of the condition formula should be a column name, the right side of the condition formula should be a specific value rather than a column name:

LookUp('Data Source', ColumnName = "A specific value")

E.G.

LookUp('[dbo].[RonderingKVV1]'; RondDate = DateValue("04/05/2019"); Råvatten)  

 

As an fixed solution, I have made a test on my side, please take a try to modify your formula as below:

LookUp(
'[dbo].[RonderingKVV1]';
RondDate = DateAdd(ThisItem.RondDate, -1, Days); /* <-- The DateAdd() function is used to calculate the previous day value of the RondDate value of current item */
Råvatten
)

Or

LookUp(
'[dbo].[RonderingKVV1]';
RondDate = DateAdd(ThisItem.RondDate, -1, Days) /* <-- The DateAdd() function is used to calculate the previous day value of the RondDate value of current item */
).Råvatten

More details about the DateAdd function, please check the following article:

DateAdd function

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Highlighted
DavidJennaway
Level: Powered On

Re: No result from LookUp (Or error message)

Your problem could be that the data is stored as a datetime, so you only get an exact match if the time portion of the two dates is identical. To resolve this, I'd use the DateDiff function to get the difference in days - e.g. DateDiff(PrevRondDate, RondDate, Days) = 1

Administrator
Administrator

Re: No result from LookUp (Or error message)

Thanks for posting in the community @PeKa6 - can you review the above replies and update the thread if they were helpful? 

 

Thank you,

 

@TopShelf-MSFT 

Helpful resources

Announcements
firstImage

PowerApps Monthly Community Call!

Join us next Wednesday for our Demo Extravaganza, October 16, 2019 8am PDT.

firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 363 members 4,227 guests
Please welcome our newest community members: