cancel
Showing results for
Did you mean:
Anonymous
Not applicable

## Y value calculation for Data Cards disappearing

Hi,

My app has a screen with about 70 datacards, some of which do not appear for certain users. To position the datacards, I calculate the Y value with a simple formula, but now that I am finished with creating the screen, I see that the formulas have been deleted. In their place is a simple number.

For example, one formula for DataCard 2's Y value might be:

DataCard1.Y + DataCard1.Height

Or DataCard3's Y value might be:

If(DataCard2.Visible = true,

DataCard2.Y + DataCard2.Height,

DataCard1.Y + DataCard1.Height

)

There were no errors in the formulas when I wrote them. But now the formulas have been replaced with a number, such as "400".

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

Try this:

If(DataCard2.Visible = true,

Value(DataCard2.Y) + Value(DataCard2.Height),

Value(DataCard1.Y) + Value(DataCard1.Height)

)

If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,

Gonçalo Nogueira

Check my User Group (pt-PT)!

Last Post on Community

My website!

2 REPLIES 2
Super User

Datacard Y values are a finicky thing... If you update anything, anything at all that might affect Y (such as any of their heights, or the forms height), then the values will revert back to static numbers.

What I would recommend instead is to increase the number of columns in your Form, then use the drag-and-drop interface for the datacards from the form field editor. Once they are in a 'good enough' visual order, I would then change the Width of the datacards depending on formulae.

So for example, if there's normally 3 cards on that row, and one needs to be hidden , then you make the Width values of the first two equal to

``````If(Datacard3.Visible,
Parent.Width/3,
Parent.Width/2
)``````

Width is less likely to (but still can be) reset by the form when things change.

 @iAm_ManCat My blog

 Please 'Mark as Solution' if someone's post answered your question and always 'Thumbs Up' the posts you like or that helped you! Thanks! You and everyone else in the community make it the awesome and welcoming place it is, keep your questions coming and make sure to 'like' anything that makes you 'Appy Sancho Harker, MVP
Super User

Try this:

If(DataCard2.Visible = true,

Value(DataCard2.Y) + Value(DataCard2.Height),

Value(DataCard1.Y) + Value(DataCard1.Height)

)

If my reply provided you with a solution, pleased mark it as a solution ✔️!

Best regards,

Gonçalo Nogueira

Check my User Group (pt-PT)!

Last Post on Community

My website!

Announcements

#### Celebrating a New Season of Super Users with Charles Lamanna, CVP Microsoft Business Applications

February 8 was the kickoff to the 2024 Season One Super User program for Power Platform Communities, and we are thrilled to welcome back so many returning Super Users--as well as so many brand new Super Users who started their journey last fall. Our Community Super Users are the true heroes, answering questions, providing solutions, filtering spam, and so much more. The impact they make on the Communities each day is significant, and we wanted to do something special to welcome them at our first kickoff meeting of the year.   Charles Lamanna, Microsoft CVP of Business Applications, has stressed frequently how valuable our Community is to the growth and potential of Power Platform, and we are honored to share this message from him to our 2024 Season One Super Users--as well as anyone who might be interested in joining this elite group of Community members.     If you want to know more about Super Users, check out these posts for more information today:    Power Apps: What is A Super User? - Power Platform CommunityPower Automate: What is A Super User? - Power Platform Community Copilot Studio: What is A Super User? - Power Platform Community Power Pages: What is A Super User? - Power Platform Community

#### February 2024 User Group Update: Welcoming New Groups and Highlighting Upcoming Events

It's a new month and a brand-new year, which means another opportunity to celebrate our amazing User Groups!Each month, we highlight the new User Groups that have joined the community. It's been a busy season for new groups, because we are thrilled to welcome 15 New User Groups! Take a look at the list below, shared by the different community categories. If your group is listed here, give this post a kudo so we can celebrate with you!   We love our User Groups and the difference they make in the lives of our Community! Thank you to all the new User Groups, new User Group leaders--we look forward to hearing about your successes and the impact you will leave!   In addition to our monthly New User Group spotlight, it's a great time to share some of the latest events happening in our User Group community! Take a look at the list below to find one that fits your schedule and need! There's a great combination of in-person and virtual events to choose from. It's a great time of year to connect and engage with User Groups both locally and online. Please Welcome Our NEW User Groups   Power Platform: Heathcare Power Platform User Group Power Platform Connect Hub Power Platform Usergroup Denmark Mexico Norte- Power Platform User Group Pune Power User Group Sudbury Power Platform User GroupMicrosoft User Group GhanaMPPBLR - Microsoft Power Platform Bengaluru User Group Power Apps:   Myrtle Beach Power Platform User GroupAnanseTechWB PowerApps Copilot Studio: Pathfinders Power Platform Community Dynamics365: Cairo, Egypt MSD 365 Business Central/NAV/F&O User GruopMS Dynamics 365 Business Central LatamCincinnati OH D365 F&O User Group February User Group Events February 2024 Cleveland Power Platform User GroupPortallunsj - Februar 2024Indiana D365/AX February User Group MeetingQ1 2024 KC Power Platform and Dynamics 365 CRM Users Group