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 / Saving datacardvalue a...
Power Apps
Answered

Saving datacardvalue as number

(0) ShareShare
ReportReport
Posted on by 9

Hello All,

This is my first post. 

I have a collection from a sql database table. Which is collected as soon as the screen is visible.

In this screen I am collecting order details for customers. I am finding difficulty in saving the data form to collection.

In the collection I have a column pieces (number of items ordered). In sql database this is "INT" (Integer) type.

 

When I collect my collection it is giving incompatible type error.

 

Collect(ProductDetails, { productname : productname.Text, productcode : productcode.Text, pieces : pieces.Text });ResetForm('Form-proddetails');NewForm('Form-proddetails')

 

How can I save the text in as number?

 

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

    @rawatn 

    My assumption is you want to save the pieces field as a number

    pieces : pieces.Text

     

    To convert to a number we can use the VALUE function

    pieces: Value(pieces.Text)

     

    We can also ROUND the value if needed

    pieces: Round(Value(pieces.Text))

     

     

    ---
    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."

  • rawatn Profile Picture
    9 on at

    Thanks a lot. I was strangling the code for a while. 

  • mdevaney Profile Picture
    29,993 Moderator on at

    @rawatn 

    You're welcome.  Glad I could get you unstuck.

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 352 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 323

#3
Mohsin Ali Profile Picture

Mohsin Ali 226

Last 30 days Overall leaderboard