cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
singhs
Helper I
Helper I

Can we auto arrange multiple labels in a DataCard? (Labels coming in on condition)

I want to include multiple labels in a DataCard on condition and need to arrange them such that there is always some buffer space between two labels and the height of the DataCard should also get arranged so as to cover only the available labels. For example in the picture shown below, instead of text from one of the labels overlapping the text from the other label, I want them to arrange themselves according to the availability of the labels.

 

Multiple labels overlapping each otherMultiple labels overlapping each other

The labels appear or disappear on the basis of availability of the text. The formula being used to govern visibility for each label looks like following:

 

!IsBlank(ThisItem.<ColumnName>)

 

So, for example, if the third label disappears due to being blank, then I need the DataCard to arrange the available labels label1, label2, label4 and label5 to arrange themselves in a vertical column and also the height of the DataCard should be arranged accordingly.

Any help is appreciated. Thanks in advance!

3 ACCEPTED SOLUTIONS

Accepted Solutions
panand99
Solution Supplier
Solution Supplier

Hi @singhs 

 

You need to use the X,Y cooordines of the text box in order to solve this.

View solution in original post

Thanks @panand99 I got it by looking at the DataCardValue label inside the DataCard. Its Y value looked like:

 

DataCardKey11.Y + DataCardKey11.Height + 5

 

So I replicated the same for the others. I want to accept your answer as well as this answer as a solution, I wonder if I can do that.

View solution in original post

I found a way to automatically set the height of the DataCard by setting the height of the datacard as 0. This sets the height of the datacard to just enough so that it covers all the items inside it.

View solution in original post

5 REPLIES 5
panand99
Solution Supplier
Solution Supplier

Hi @singhs 

 

You need to use the X,Y cooordines of the text box in order to solve this.

View solution in original post

So you mean to say we need to use the x position of the previous and the height of the previous label to arrange them one over the other?

Can you please give an example of it?

Thanks @panand99 I got it by looking at the DataCardValue label inside the DataCard. Its Y value looked like:

 

DataCardKey11.Y + DataCardKey11.Height + 5

 

So I replicated the same for the others. I want to accept your answer as well as this answer as a solution, I wonder if I can do that.

View solution in original post

Hi @panand99,

 

I guess I was a little too early in accepting the solution because the height of the datacard is not adjusting accordingly. I tried entering the following in the 'Height' of the DataCard, but it didn't work:

 

5 + DataCardKey11.Height + 5 + DataCardValue11.Height + 5 +
If(IsBlank(ThisItem.ScholasticAchievement2College), Label9.Height + 5,0) +
If(IsBlank(ThisItem.ScholasticAchievement3College), Label10.Height + 5,0) +
If(IsBlank(ThisItem.ScholasticAchievement4College), Label11.Height + 5,0) +
If(IsBlank(ThisItem.ScholasticAchievement5College), Label12.Height + 5,0)

Can you please help on that too?

I found a way to automatically set the height of the DataCard by setting the height of the datacard as 0. This sets the height of the datacard to just enough so that it covers all the items inside it.

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Power Apps June 2021

June Power Apps Community Call

Don't miss the call this month on June 16th - 8a PDT

Top Solution Authors
Top Kudoed Authors
Users online (51,617)