web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Need help adding a col...
Power Apps
Unanswered

Need help adding a column to a collection with conditional logic

(0) ShareShare
ReportReport
Posted on by 690 Super User 2025 Season 2
Hello -

Need help adding a column to a collection with conditional logic.

The expression below to add the Zone column to the collection works with the single if statement but what I need to do is the following:

If 'Store Number' is values 1 - 3 then Zone value is "A"
If 'Store Number' is values 4 - 8 then Zone value is "B"

Appreciate any suggestions!

ClearCollect(
    ColStorePriceswithfilterwithZone,
    AddColumns(
        ColStorePriceswithFilter,
        Zone,
        If(
            'Store Number' = 4,
            "B"
        )
    )
);
Categories:
I have the same question (0)
  • Verified answer
    victorcp Profile Picture
    2,350 Moderator on at
    Need help adding a column to a collection with conditional logic
    Hey! hope you are doing fine
     
     
    you can just add the other conditions like this:
    ClearCollect(
        ColStorePriceswithfilterwithZone,
        AddColumns(
            ColStorePriceswithFilter,
            Zone,
            If(
                'Store Number' in [1,2,3],
                "A",
                'Store Number' in [4,5,6,7,8],
                "B"
                // you can add as many conditions as you want
            )
        )
    );
    Hope it helps :)
  • Cgangweg01 Profile Picture
    690 Super User 2025 Season 2 on at
    Need help adding a column to a collection with conditional logic
    Thank you victorcp!
    Done!
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 757 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 322 Super User 2025 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 209 Super User 2025 Season 2

Last 30 days Overall leaderboard