cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
rawatn
Level: Powered On

Saving datacardvalue as number

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Saving datacardvalue as number

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

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Saving datacardvalue as number

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

View solution in original post

rawatn
Level: Powered On

Re: Saving datacardvalue as number

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

Super User
Super User

Re: Saving datacardvalue as number

@rawatn 

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

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (6,076)