cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Helper V
Helper V

Adding multiple conditions to check if a request has been submitted to SharePoint list

Hello,

 

I have a formula that checks if the user has already submitted based on a column value "Submitted"  and navigates the user to another screen within the app. I want to add another condition to allow the user to submit a request if the Update Type column value is switched to Canceled. Here is the current formula that i have. 

 

If(!IsEmpty(Filter('Request', CreatorName = varUser.FullName && RequestStatus.Value = "Submitted"))

 

 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @patty789 ,

 

try this as advised in the other thread:

 

If(!IsEmpty(Filter('Request', CreatorName.DisplayName = varUser.FullName && RequestStatus.Value = "Submitted" && Isblnak(UpdateType.Value))), 
Navigate(PersonalRequestScreen, ScreenTransition.Fade), 
!IsEmpty(Filter('Request', UpdateType.Value = "Cancel Request")), UpdateContext({showPopup:true}))

 

 

https://powerusers.microsoft.com/t5/forums/replypage/board-id/PowerAppsForum1/message-id/189767


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more. 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

6 REPLIES 6
Impactful Individual
Impactful Individual

Hi @patty789 

For multiple conditions, you should use nested IF statements.

Please try below code:

If(!IsEmpty(Filter('Request', CreatorName = varUser.FullName), If(!IsEmpty(Filter('Request', RequestStatus.Value = "Submitted"), -------- put your logic here-------- , false ) , false )

@hardikv Thank you for your response but i am getting an error saying that i have invalid number of arguments received 2 expected 1. So my the column on my SP list is called UPDATETYPE is a choice value and has two choices, Update and
Cancel. User can select one of those two choice, but if user selects Cancel i want the user to be able to submit another request. Currently it does not allow user to submit a new request as it is already submitted . How can i incorporate this into the logic of the formula? 

This is the formula that i have and its ignoring the other If statement 

 

If(!IsEmpty(Filter('Request', CreatorName = varUser.FullName && RequestStatus.Value = "Submitted")),Navigate(PersonalRequestScreen, ScreenTransition.Fade)) Or If(!IsEmpty(Filter('Request', UpdateType.Value = "Cancel")),UpdateContext({showPopup:true}))

If the user already submitted a previous request and then decides to cancel the request i want the user to be able to submit another one. 

Does any body know why it wont check the other condition? 

Hi @patty789 ,

Try this

If(
   !IsEmpty(
      Filter(
         'Request', 
         CreatorName = varUser.FullName && 
         RequestStatus.Value = "Submitted"
      )
   ),
   Navigate(
      PersonalRequestScreen, 
      ScreenTransition.Fade
   ),
   !IsEmpty(
      Filter(
         'Request', 
          UpdateType.Value = "Cancel"
      )
   ),
   UpdateContext({showPopup:true})
)

 

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.

@WarrenBelz Thank you for you response, yet app still won't let me submit another request after i have cancel the request. The record still show on the SP list which i still want that record there. How can i accomplish this? 

Hi @patty789 ,

 

try this as advised in the other thread:

 

If(!IsEmpty(Filter('Request', CreatorName.DisplayName = varUser.FullName && RequestStatus.Value = "Submitted" && Isblnak(UpdateType.Value))), 
Navigate(PersonalRequestScreen, ScreenTransition.Fade), 
!IsEmpty(Filter('Request', UpdateType.Value = "Cancel Request")), UpdateContext({showPopup:true}))

 

 

https://powerusers.microsoft.com/t5/forums/replypage/board-id/PowerAppsForum1/message-id/189767


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Regards,
Krishna
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members find it more. 


I hope this resolved your issue if you see any challenge/need further help please let me know I am always happy to do it for my community.

Proud to be a Super User!

Regards,
KrishnaV
Business Applications MVP
Twitter | Linkedin | YouTube | GitHub
If this post helps you give a 👍 and if it solved your issue consider Accept it as the solution to help the other members / new members of the community.

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (64,080)