cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Big_S
Post Patron
Post Patron

Deleagation warning it works before

Hi Guys,
Does anyone know what happened to my code? It works before, currently, I have 3k records in SQL as DataSouce, attached is the screenshot of my code and warning message

Big_S_1-1635318137235.png

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @Big_S ,

I thought you might work that one out following what I was doing . . . I also added a suggestion on the date filters.

With(
   {
      wreq: 
      Filter(
         Requests_2,
         Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value
      ),
      condition1: Value(RequestDates_1.SelectedDate)< 1 && Value(RequestDates.SelectedDate) < 1,
      condition2: Value(RequestDates.SelectedDate) < 1
      wPrin: _myProfile.UserPrincipalName
   },
   Sort(
      Filter(
         wreq,
         If(
            _managerView,
            Approver = wPrin,
            Requester = wPrin
         ) && 
         If(
            condition1,
            TransactionDate > RequestDates.SelectedDate,
            condition2,
            TransactionDate < RequestDates_1.SelectedDate,
            TransactionDate <= RequestDates_1.SelectedDate && TransactionDate > RequestDates.SelectedDate
         )
      ),
	  "TransactionDate",
      Descending
   )
)

NOTE - this filter (at the top) must return less than your Delegation limit

Filter(
   Requests_2,
   Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value
)

 

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.

 

View solution in original post

7 REPLIES 7
WarrenBelz
Super User
Super User

Hi @Big_S ,

Note this was OCRd (please post your code in Text), so watch spelling and syntax bits, but you should get the idea.

With(
   {
      wreq:
      With(
         {wPrin:myProfile.UserPrincipalName},		 
         Sort(
            Filter(
               Requests_2, 
               Status = 1 &&
               ApprovalStatus = Dropdown3.SelectedText.Value && 
               If(
                  managerView,
               ‬   Approver = wPrin,
                  Requester = wPrin
               )
            ), 
            "TransactionDate",
            Descending
         )
      ),
      conditionl:RequestDates_l.SelectedDate = Blank() && RequestDates.SelectedDate = Blank(),
      condition2: RequestDates.SelectedDate = Blank()
   },
   Filter(
      wreq, 
      If(
         conditionl, 
         TransactionDate > RequestDates.SelectedDate,
         condition2, 
         TransactionDate < RequestDates_l.SelectedDate,
         TransactionDate <= RequestDates_l.SelectedDate && TransactionDate > RequestDates.SelectedDate
      )
   )
)

 

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.

 

hi @WarrenBelz ,

I apply your code, I still get the delegation warning
here's the screenshot

Big_S_0-1635325538371.png

here's the code

With(
{
wreq: With(
{wPrin: _myProfile.UserPrincipalName},
Sort(
Filter(
Requests_2,
Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value && If(
_managerView,
Approver = wPrin,
Requester = wPrin
)
),
"TransactionDate",
Descending
)
),
condition1: RequestDates_1.SelectedDate = Blank() && RequestDates.SelectedDate = Blank(),
condition2: RequestDates.SelectedDate = Blank()
},
Filter(
wreq,
If(
condition1,
TransactionDate > RequestDates.SelectedDate,
condition2,
TransactionDate <= RequestDates_1.SelectedDate,
TransactionDate <= RequestDates_1.SelectedDate && RequestDates.SelectedDate
)
)
)


 



@Big_S ,

It seems to be the If() statement as well  - we will go down another level . . .

With(
   {
      wreq:
      Sort(
         Filter(
            Requests_2, 
            Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value
         ),
         "TransactionDate",
         Descending
      ),
      conditionl:RequestDates_l.SelectedDate = Blank() && RequestDates.SelectedDate = Blank(),
      condition2: RequestDates.SelectedDate = Blank(),
      wPrin:myProfile.UserPrincipalName
   },
   Filter(
      wreq,
      If(
         managerView,
         Approver = wPrin,
         Requester = wPrin
      ) &&
      If(
         conditionl, 
         TransactionDate > RequestDates.SelectedDate,
         condition2, 
         TransactionDate < RequestDates_l.SelectedDate,
         TransactionDate <= RequestDates_l.SelectedDate && TransactionDate > RequestDates.SelectedDate
      )
   )
)

 

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.

Hi @WarrenBelz 
now the TransactionDate got the warning
here's the screenshot

Big_S_0-1635327043812.png

here's the code I followed
With(
{
wreq: Sort(
Filter(
Requests_2,
Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value
),
"TransactionDate",
Descending
),
condition1: RequestDates_1.SelectedDate = Blank() && RequestDates.SelectedDate = Blank(),
condition2: RequestDates.SelectedDate = Blank(),
wPrin: _myProfile.UserPrincipalName
},
Filter(
wreq,
If(
_managerView,
Approver = wPrin,
Requester = wPrin
) && If(
condition1,
TransactionDate > RequestDates.SelectedDate,
condition2,
TransactionDate < RequestDates_1.SelectedDate,
TransactionDate <= RequestDates_1.SelectedDate && TransactionDate > RequestDates.SelectedDate
)
)
)

Hi @Big_S ,

I thought you might work that one out following what I was doing . . . I also added a suggestion on the date filters.

With(
   {
      wreq: 
      Filter(
         Requests_2,
         Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value
      ),
      condition1: Value(RequestDates_1.SelectedDate)< 1 && Value(RequestDates.SelectedDate) < 1,
      condition2: Value(RequestDates.SelectedDate) < 1
      wPrin: _myProfile.UserPrincipalName
   },
   Sort(
      Filter(
         wreq,
         If(
            _managerView,
            Approver = wPrin,
            Requester = wPrin
         ) && 
         If(
            condition1,
            TransactionDate > RequestDates.SelectedDate,
            condition2,
            TransactionDate < RequestDates_1.SelectedDate,
            TransactionDate <= RequestDates_1.SelectedDate && TransactionDate > RequestDates.SelectedDate
         )
      ),
	  "TransactionDate",
      Descending
   )
)

NOTE - this filter (at the top) must return less than your Delegation limit

Filter(
   Requests_2,
   Status = 1 && ApprovalStatus = Dropdown3.SelectedText.Value
)

 

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.

 

View solution in original post

Hi @WarrenBelz ,

Im still working on it, your code doesnt have errors anymore but the records doesnt show to the gallery im confused now

Hi @WarrenBelz 
I Figured it out!! your solution works its my fault in my App OnStart Properties my variable _myProfile got error THANK YOUUUUU SO MUCCCHHHHH!!!! soo happy 🙂

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,549)