cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
singhs
Level: Powered On

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.

 

labelarrangement.pngMultiple 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
Level 10

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

Hi @singhs 

 

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

View solution in original post

singhs
Level: Powered On

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

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

singhs
Level: Powered On

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

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
Level 10

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

Hi @singhs 

 

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

View solution in original post

Highlighted
singhs
Level: Powered On

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

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?

singhs
Level: Powered On

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

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

singhs
Level: Powered On

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

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?

singhs
Level: Powered On

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

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 241 members 5,441 guests
Please welcome our newest community members: