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 Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

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 (1,234)