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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Storing a set of numbe...
Power Apps
Unanswered

Storing a set of numbers: handling the collection

(0) ShareShare
ReportReport
Posted on by

hi, i'm making a game app. 

 

for the app i need to store some numbers inside a collection. how should i use it correctly?

i need to create an empty collection at the app start and then on the click of a button i need to add a value to a collection.

on start i did

ClearCollect(MyColl,0);

on the button onSelect i get the value from a textbox

Collect(MyColl,Right(MyTextField.Text,2));

 

 

i have two issues:

1) the collection start with a 0 instead of just being initialized and stay empty

2) the onSelect gives me an error because it says it require a record

 

how to fix?

Categories:
I have the same question (0)
  • Nogueira1306 Profile Picture
    7,390 Super User 2024 Season 1 on at

    First problem:

     

    Clear(MyColl);

     

    This formula will delete ALL items in your collection.

     

    Second problem:

     

    Collect(
    MyColl,
    {
    MyField: Right(MyTextField.Text,2)
    }
    );

     

    https://learn.microsoft.com/en-us/power-platform/power-fx/reference/function-left-mid-right

     

    If you need additional help please tag me in your reply and please like my reply.
    If my reply provided you with a solution, pleased mark it as a solution ✔️!

    Best regards,

    Gonçalo Nogueira

    Check my LinkedIn!

    My website!

    My blog!

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 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard