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 / Component Gallery - Er...
Power Apps
Answered

Component Gallery - Error referring to Column Not even in the Formula

(0) ShareShare
ReportReport
Posted on by 427

So, this has me completely confused:

 

I have a Gallery inside a Component.

The Component has an "Items" Property that is set to:

Table(
 {ID:"Comment_1", Comment: "SampleText", ParentComments: "", Created: Today(), 'Created By':{DisplayName:"Sample Author",Mail:"sample@email.com"}},
 {ID:"Comment_2", Comment: "Sample Text 2", ParentComments: "", Created: Today(), 'Created By':{DisplayName:"Sample Author",Mail:"sample@email.com"}}
)

 

There is a Gallery inside the Component, with the Gallery.Items Property set to:

SortByColumns(
 AddColumns(
 AddColumns(Parent.Items
 ,"_id",Text(ID)
 ,"ParentIDHash",If(IsBlank(ParentComments),ID&"",ParentComments&"_"&ID)
 ) 
		,"SortOrder",If(
			Find("_",ParentIDHash)=Blank(),
			Value(ParentIDHash),
			Left(ParentIDHash,Value(Find("_",ParentIDHash)-1))
		)
 )
 ,"SortOrder","ParentIDHash"
)

 

The Gallery.Items is throwing a Runtime Error: "The value 'Comment' cannot be converted to a Number"

james_hathaway_0-1679308877801.png

 

As you can see, the formula above does NOT refer to the 'Comment' column at all!

 

The same error is thrown if I add the component into an App.

I have tried removing the Gallery.Items Formula and re-entering.

I have tried removing the Component.Items formula and re-entering.

I have tried closing the App/Component Library and reopening.

No joy.

 

Anyone have any Ideas?

Categories:
  • RJM07 Profile Picture
    801 on at

    RJM07_0-1679311662300.png

    This part refers to Comment, So I would assume it's something to do with that... Unsure what though

  • RJM07 Profile Picture
    801 on at

    Maybe change the "Sample Text 2" to "Sample Text Two" and see if that works? I'm also confused, sorry if I'm not much help

  • james_hathaway Profile Picture
    427 on at

    [post edited and text removed, as it was a duplicate]

    pity there was not a way to delete a post created in error!

  • Verified answer
    james_hathaway Profile Picture
    427 on at

    Aha!
    After some trial and error commenting out pieces of code - I found the error in the Gallery.Items formula:

     

    It was the Value(ParentIDHash) function - the "ParentIDHash" is blatantly a String value (with "_"'s in it), and this couldn't be converted to a Value.

     

    Still, although I solved my own problem, it does highlight a bug in the the PowerApps Error Checking functionality...

     

    The error shown was referring to a Column not used in the Formula at all -

    (My current theory is that it must've simply referred to the first column (alphabetically) in the Collection).

     

    Thanks anyway though!

    James.

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

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard