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 / How to split a value f...
Power Apps
Answered

How to split a value from a collection

(0) ShareShare
ReportReport
Posted on by 353

Hello all,

 

I am trying to Split a value from a collection, example of the value from the collection: "4/16/2020 12:00 AM". I am trying to pick piece this string into  "4/16/2020" "12:00", and "AM" without using extra labels, I achieved this by storing the collection value into a label and then referring to the label i picked  the value apart. How can I do it straight from grabbing it from the collection itself.

 

Thanks

Categories:
  • mdevaney Profile Picture
    29,993 Moderator on at

    @mmattar 

    You could ADDCOLUMNS to your collection like this.  Then you could reference those columns in wherever needed.

    AddColumns(
     your_collection_name,
     "Date", First(Split(your_column_name, " ")).Value,
     "Time", FirstN(Split(your_column_name, " "),2).Value,
     "AMPM", Last(Split(your_column_name, " ")).Value
    );

     

    Please let me know if you require more advice 🙂

  • mmattar Profile Picture
    353 on at

    How can i go about adding these columns at the sametime as a OnSelect of a Gallery occurs that populates the collection  

  • mdevaney Profile Picture
    29,993 Moderator on at

    @mmattar 

    I would say to put the code I gave in the OnSelect property of the button.

  • mmattar Profile Picture
    353 on at

    Hey yes i actually figured that part out, i am now noticing an error saying (Invalid Argument Type DateTime, Expecting Text). I wrapped it all in a Text() function and its still not working

    Capture.PNG
  • Verified answer
    mmattar Profile Picture
    353 on at

    If anyone facing the same issue as i am, i just found it easier to store the split pieces as a variable rather than AddColumns to a collection, the addcolumns seems to be limited to what it can actually do. 

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 Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 221 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 188 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 120

Last 30 days Overall leaderboard