Hello Everyone,
I have a task to create a gallery that will show Items and their parameters.
One Item can have 1 to X parameters shown in labels, and only the Name of the items is mandatory, other parameters can be blank.
If a parameter is blank it shows as an empty space in the gallery, this causes me to lose valuable screen space marked red.

I was expecting this to work automatically like it does in FormsViewer with Visible value, content auto adjusts to available space if a card is set visible false..
What I managed so far is to automatically position labels based on the Name label, if parameter is empty it moves the label to the corner over Name label, like this:
Name = 5
Product type Y = If(IsBlank('Product type'),Name.Y,Name.Y + Name.Height + 5)
Serial number Y = If(IsBlank('Serial number'),Name.Y,'Product type'.Y + 'Product type'.Height + 5)
SIM No. Y = If(IsBlank(SIM),Name.Y,'Serial number'.Y + 'Serial number'.Height + 5)
Inventory ID Y = If(IsBlank(Inventory),Name.Y,SIM.Y + SIM.Height + 5)
Phone No. Y = If(IsBlank(Phone),Name.Y,Inventory.Y + Inventory.Height + 5)
etc..
This setup works fine if each predecesor is not blank as you can see in image Name1 and Name2
But if a parameter somewhere in the middle is empty it brakes all its successors position.
For example Name3 is missing Serial No & Invetory ID, this moves SIM No & Phone No bellow Name3 and above Product type
Or Name4 is missing Serial No & SIM No, this moves Inventory No bellow Name4 and above Product type

I think that a solution would be to give every label id based on possition, create a list of not blank ids, calculate their individual height, and then somehow use this data to calculate position of labels based on their predecesors..
But this is too advanced for me.
Please help.