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

Bad Request 400 on page load

Hi

 

Any help would be greatly appreciated.

 

I have a page that when load grabs the defaulted selected items from 2 drop downs and then in the default of some text inputs populates the results from an SPL.

 

Code for default textinput is

If(
    !IsBlankOrError(
        Text(
            LookUp(
                TimeRecords,
                Date = ddWeeks_1.Selected.Value && BillTo.Value = ddBillTo.Selected.Value && Employee.DisplayName = currentUser.FullName
            ).Hours
        )
    ),
    Text(
        LookUp(
            TimeRecords,
            Date = ddWeeks_1.Selected.Value && BillTo.Value = ddBillTo.Selected.Value && Employee.DisplayName = currentUser.FullName
        ).Hours
    )
)

 

However, on initial load I am getting Bad Request 400 messages  

 

"status": 400,
"message": "The expression \"((Date eq ())and(BillTo/Title eq null))and(Employee/Title eq 'fname sname')\" is not valid. Creating query failed.\r\nclientRequestId:
 
I assume it is because it is doing the textinputs before the dropdownlists.
 
Any ideas?
 
Thanks
 
 

 

1 ACCEPTED SOLUTION

Accepted Solutions
gabibalaban
Super User
Super User

Hi @CountJuju ,

 

Can you try this approach:

If(
   IsBlank(ddWeeks_1.Selected.Value) || IsBlank(ddBillTo.Selected.Value),
       "",
      Text(
        LookUp(
            TimeRecords,
            Date = ddWeeks_1.Selected.Value && BillTo.Value = ddBillTo.Selected.Value && Employee.DisplayName = currentUser.FullName
        ).Hours
    )
)

 

Hope it helps !

View solution in original post

2 REPLIES 2
gabibalaban
Super User
Super User

Hi @CountJuju ,

 

Can you try this approach:

If(
   IsBlank(ddWeeks_1.Selected.Value) || IsBlank(ddBillTo.Selected.Value),
       "",
      Text(
        LookUp(
            TimeRecords,
            Date = ddWeeks_1.Selected.Value && BillTo.Value = ddBillTo.Selected.Value && Employee.DisplayName = currentUser.FullName
        ).Hours
    )
)

 

Hope it helps !

View solution in original post

CountJuju
Frequent Visitor

Top Job @gabibalaban - works a treat.  I think I was trying to over complicate it.

 

Many thanks

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 (3,037)