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




@VijayTailor 

Thank you! This worked perfectly 😀

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,244)