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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / CONCAT and DISTINCT to...
Power Apps
Answered

CONCAT and DISTINCT together

(0) ShareShare
ReportReport
Posted on by 377

 Hello All,

 

I have an UpdateContext thus:

 

UpdateContext({ varConcatenatedStates: Match(Concat( varStateNames, Value & ", " ), "^(?<trim>.*), $").trim});

 

This is returning "Texas, California, Texas, Virginia"

 

How can I distinct varConcatednatedStates so that I just have one occurrence of a state name (Texas in the above string) in the result?

 

Thanks in advance!

Categories:
I have the same question (0)
  • Verified answer
    RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    I would consider applying your Distinct to the varStateNames as this is the only table in your formula.

    ie.  Distinct(varStateName, Value)

     

    I hope this is helpful for you.

     

  • rprahalad Profile Picture
    377 on at

    @RandyHayes , you literally read my mind:-). I did exactly that and I came here to Update this thread.

     

    Since I was in a ForAll Loop to Collect varStateNames, I did it proactively and slightly differently. I just did:

     

    If(Not(StateName in varStateNames), Collect(varStateNames, StateName));

     

    But thanks though! 

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 494

#2
WarrenBelz Profile Picture

WarrenBelz 352 Most Valuable Professional

#3
11manish Profile Picture

11manish 323

Last 30 days Overall leaderboard