cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

Convert table values to number

Apologies if this has been answered, but I have searched thoroughly with no apparent success. 

 

I have created a collection, 'Col_bubbledata', with a series of values which are needed as Y co-ordinates for positioning circles on a canvas. The values are entered into the column 'Y co-ordinate'. 

 

Entering the following formula within the circle's 'Y' property (under the 'advanced' tab on the right hand side of the GUI) results in an 'Expected Number value' error:

 

Col_Bubbledata.'Y co-ordinate' 

 

Reviewing the diagnostics tab, I am told "The rule produces table values which are incompatible". 

 

I have tried using the value() and text(value()) functions to convert the table values to number values, with no success.  What's the correct approach here? Is it even possible to do this? 

 

(If it's relevant, I am using @davidni's scatterplot creation method, and this is a workaround to create a best fit line. I do of course appreciate that this is not an ideal situation, but I need to create the scatterplot within powerapps as my company has no powerBI (or any alternative method of) access for this application. I am extremely grateful to David for his contributions here, and for the guidance he has given me previously.) 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User
Super User

Re: Convert table values to number

Hi @Anonymous 

The Y property of the circle control requires a single numeric value.

Col_Bubbledata is a collection of records. As an example, let's imagine that Col_Bubbledata contains 3 records. If we were to use the syntax Col_Bubbledata.'Y co-ordinate', which one of these 3 rows are we referring to ? It's this ambiguity that produces the error "The rule produces table values which are incompatible".

David's scatterplot technique uses a gallery control - a control that binds to multiple records. Within a gallery control, there's an item template. The contents of this item template will repeat for each row in the collection.

Thefore if you were to add a gallery control, add your circle control inside the item template, and set the Y property so that it refers to ThisItem like so...

ThisItem.'Y co-ordinate'

that should hopefully set you on the right track. You'll need to implement some of the other nuances that David describes in his post, but this would at least solve this particular error message.

https://blogs.msdn.microsoft.com/davidni/2017/05/25/scatter-plots-in-powerapps-using-a-gallery-control/

Hope that's of some help to you.

View solution in original post

2 REPLIES 2
Highlighted
Super User
Super User

Re: Convert table values to number

Hi @Anonymous 

The Y property of the circle control requires a single numeric value.

Col_Bubbledata is a collection of records. As an example, let's imagine that Col_Bubbledata contains 3 records. If we were to use the syntax Col_Bubbledata.'Y co-ordinate', which one of these 3 rows are we referring to ? It's this ambiguity that produces the error "The rule produces table values which are incompatible".

David's scatterplot technique uses a gallery control - a control that binds to multiple records. Within a gallery control, there's an item template. The contents of this item template will repeat for each row in the collection.

Thefore if you were to add a gallery control, add your circle control inside the item template, and set the Y property so that it refers to ThisItem like so...

ThisItem.'Y co-ordinate'

that should hopefully set you on the right track. You'll need to implement some of the other nuances that David describes in his post, but this would at least solve this particular error message.

https://blogs.msdn.microsoft.com/davidni/2017/05/25/scatter-plots-in-powerapps-using-a-gallery-control/

Hope that's of some help to you.

View solution in original post

Highlighted
Anonymous
Not applicable

Re: Convert table values to number

Thanks. Adding a new gallery overlaid on the original gallery, and setting the second gallery's control to the desired collection solved the issue. Much appreciated!

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (7,722)