cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
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
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.

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (8,298)