cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Skilled Sharer
Skilled Sharer

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
Helper I
Helper I

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

Highlighted
Helper I
Helper I

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
Highlighted
Skilled Sharer
Skilled Sharer

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
Helper I
Helper I

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?

Highlighted
Helper I
Helper I

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

Highlighted
Helper I
Helper I

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?

Highlighted
Helper I
Helper I

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,495)