cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
timl
Super User
Super User

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
timl
Super User
Super User

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.

Anonymous
Not applicable

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
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (2,298)