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

IF statement on CHOICE column from SharePoint

Hi Power Apps Community,

I am trying to perform an IF statement based on a SharePoint field - which is a CHOICE type.

Based on what I use below, I get an error: "Invalid argument type". Not sure what I am missing.

If(CollectionName.Field = "Not Available", "No", "Yes")

Note: the SharePoint list is being stored in a Collection.

I would really appreciate any help.

Thank you in advance.

1 ACCEPTED SOLUTION

Accepted Solutions
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Data_Enthusiast ,

You are using collection in If condition, 
The collection is basically Table Type. So for validation, you need to Get the value that you want to validate.

See below - in the below example I am using FirstN and Last that give me my value that is Combobox type and validation with value.

If(Last(FirstN(TestAk,1).Complexity).Complexity.Value="Transfer to future date","Yes","No")

VijayTailor_0-1602435130839.png

 


Thanks,

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




View solution in original post

2 REPLIES 2
VijayTailor
Resident Rockstar
Resident Rockstar

Hi @Data_Enthusiast ,

You are using collection in If condition, 
The collection is basically Table Type. So for validation, you need to Get the value that you want to validate.

See below - in the below example I am using FirstN and Last that give me my value that is Combobox type and validation with value.

If(Last(FirstN(TestAk,1).Complexity).Complexity.Value="Transfer to future date","Yes","No")

VijayTailor_0-1602435130839.png

 


Thanks,

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




View solution in original post

@VijayTailor 

Thank you! This worked perfectly 😀

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

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

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,233)