cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
onurisik
Frequent Visitor

Lookup Function with Date equal Date (without delegation limit)

Hello guys,

 

I checked almost all messages but anyway I couldn't find any solution for remove delegation errors...

In my app I tried to get currency rate from 'Rate' table with DatePicker control...

 

When I used that formula;

 

LocalPrice: Value(TextInput2_85.Text) * If(
ComboBox1_64.Selected.ID = 1,LookUp(Rate,Date = DatePicker1.SelectedDate, EUR),
ComboBox1_64.Selected.ID = 2,LookUp(Rate,Date = DatePicker1.SelectedDate, USD))

 

No any error, alert or something. But value is zero...

In Rate table, Date column is Date...

 

When I changed formula to;

 

LocalPrice: Value(TextInput2_85.Text) * If(
ComboBox1_64.Selected.ID = 1,LookUp(Rate,Text(Date) = Text(DatePicker1.SelectedDate), EUR),
ComboBox1_64.Selected.ID = 2,LookUp(Rate,Text(Date) = Text(DatePicker1.SelectedDate), USD))

 

Value is correct, but I get a deligation error...

 

My data in sharepoint list. If you use lookup with text deligation limit is 2000, but with date no limit...

How can I fixed that?

Thanks...

 

1 ACCEPTED SOLUTION

Accepted Solutions
mdevaney
Super User III
Super User III

@onurisik
When using LOOKUP on a SharePoint list and Date type data you will not be able to see past 2,000 rows. Currently dates do not have support for delegation. Only the data types and functions in this list do: https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/.

The only way I know to get around this is to change your dates to numbers. Example 2020-02-08 becomes 20200208 in your SharePoint list.

Then when you choose a Date using the DatePicker you can load a variable like this. Put this code in the OnChange property of the DatePicker.

Set(myChosenDate, Value(Text(DatePicker1.SelectedDate, “yyyymmdd”)))

Finally you can rewrite any LOOKUP formulas in a style similar to this.

LookUp(Rate, Date=myChosenDate, EUR)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

3 REPLIES 3
WarrenBelz
Super User III
Super User III

Hi @onurisik ,

Date queries are not delegable and cannot be properly queried on large data sets, however if you have less than 2000 records in your target lists, collect them and query the collection (you will have to increase the limit in PowerApps settings) and your formulas should work as expected.

 

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.

mdevaney
Super User III
Super User III

@onurisik
When using LOOKUP on a SharePoint list and Date type data you will not be able to see past 2,000 rows. Currently dates do not have support for delegation. Only the data types and functions in this list do: https://powerapps.microsoft.com/en-us/blog/sharepoint-delegation-improvements/.

The only way I know to get around this is to change your dates to numbers. Example 2020-02-08 becomes 20200208 in your SharePoint list.

Then when you choose a Date using the DatePicker you can load a variable like this. Put this code in the OnChange property of the DatePicker.

Set(myChosenDate, Value(Text(DatePicker1.SelectedDate, “yyyymmdd”)))

Finally you can rewrite any LOOKUP formulas in a style similar to this.

LookUp(Rate, Date=myChosenDate, EUR)

—-
Please Accept as Solution if this post answered your question so others may find it more quickly. If you found this post helpful consider giving it a Thumbs Up.

View solution in original post

Thanks, It's done...

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,662)