cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Zantarel
Frequent Visitor

Control property X evaluates to Blank when used in a formula

I have created a scrollable gallery, and am using headers (labels) outside the gallery to create an excel-like view for the user, using this idea: https://michalsacewicz.com/power-apps-horizontal-scroll-in-a-vertical-gallery-with-freeze-panes-effe... 

 

It all works fine, when I scroll the gallery, the headers move with it etc. All good. However, I am now adding filtering to the gallery - so there's a search box where they can search the title field and some dropdowns. The search/filtering itself is working as expected. but the first time (and only the first time) that a filter is applied (whether by search text box or dropdown selection), the X property of the arrow at the end of the gallery (to select parent) evaluates to blank when used in a formula, even though it is still in the right place on the page. 

 

See screenshot: - on the right, the position x is showing 1316 (and it's in the right place on the screen), but when used in a formula, it shows blank. The formula used in the label is:   "EditIcon.X: '" & EditIcon_RTRGallery.X & "'"  

 

The effect of this is that the headers above these fields 'disappear' because their location is not 'less than' blank. 

 

Now, if I change the search field - either by removing a character, changing it completely, or adding a letter etc, then it suddenly works as expected, and in a formula EditIcon_RTRGallery.X will give a number instead of a blank. But I can't work out why it's doing it on the first time. I don't want users to have to mess around with the search box to get it to work. I've included a second screenshot that shows when I added more words, the headers reappear and the label at the bottom shows the actual X value instead of blank. If I then change it back to just the first word, the headers stay and everything is normal. 

 

Any ideas?!  

1 ACCEPTED SOLUTION

Accepted Solutions
v-jefferni
Community Support
Community Support

Hi @Zantarel ,

 

I have repro this issue but found a workaround:

Do not use Self or Parent functions, just apply control names in formula bars.

 

On your end, X of EditIcon_RTRGallery:

 

Screen.Width - EditIcon_RTRGallery.Width -20

 

 

Visible of ColumnName Labels:

 

Label.X+Label.Width/3 < EditIcon_RTRGallery.X

 

 

Please have a try and check if it works for you.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
v-jefferni
Community Support
Community Support

Hi @Zantarel ,

 

I have repro this issue but found a workaround:

Do not use Self or Parent functions, just apply control names in formula bars.

 

On your end, X of EditIcon_RTRGallery:

 

Screen.Width - EditIcon_RTRGallery.Width -20

 

 

Visible of ColumnName Labels:

 

Label.X+Label.Width/3 < EditIcon_RTRGallery.X

 

 

Please have a try and check if it works for you.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

 

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Thank you!! I always thought using parent and self were better options, but as you say, that totally fixes the problem!! Thanks!!!!!

Helpful resources

Announcements
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Users online (2,084)