Hey Alexis
Three options:
Use the Label tab on the ribbon
This saves you several clicks per layer.
Select the layer in the Layer List, now from the Label tab on the ribbon, select the correct column from the Label Using list
The second option is to open the workspace into a text editor and change the expression here.
This would certainly require fewer clicks but also requires you to know where to make the changes.
You need to look for this part in the workspace: Set Map Layer
:
Set Map
Layer 1
Display Graphic
Global Pen (2,2,3175935) Brush (1,16777215,16777215) Symbol (35,16744448,4,"MapInfo Symbols",256,0) Line (2,2,16728064) Font ("Precision Sans W",0,10,0)
Label Line Arrow Position Right Font ("Precision Sans W",0,10,0) Pen (1,2,0)
With ID
Parallel On Auto Off Overlap Off Duplicates On Offset 2
Visibility On
You have to look for the With ID expression in the statement. If you are lucky, the ID
column is only used for the layers you want to change to the Max
column. If it's used for other layers too where you don't want to change it, you need to make sure you only change it for those layers.
With the workspace open in MapInfo Pro, you can find the ID of the layer in this way:
Start by figuring out the layer number of the first layer. You can do this by using the method mentioned above or by opening the MapBasic window and changing the label expression of the layer.
The expression shown in the MapBasic window will look like this:
Set Map Window 3028 Layer 2 Label With Max
In the above, 2
is the layer number we are interested in.
Type these two lines into the MapBasic window:
Dim nLayer as Integer
nLayer = 2
nLayer
is now our placeholder for the layer we want to modify. Using a variable allows us to change the layer number.
As the next step, we have to create a manual loop. You can't loop via the MapBasic window but we can do this by selecting the code the execute and then hitting the Enter key as many times as needed.
This is the code we want to execute a given number of times:
nLayer = nLayer + 1
Set Map Window 3028 Layer nLayer Label With Max
Print "Just changed layer " + nLayer
In the first line, we add one to the layer number so that we go through multiple layers. In the second line, we change the label expression, and in the third line, we print the layer we just changed to the Message window.
You can use the same method as above to also find the layer number of the last layer you want to change. This gives you an idea of how many times you need to run the script.
Now it's time to run the script. Select all three lines in the MapBasic window. Make sure you select all the text from each of the three lines and then hit the Enter key on your keyboard. This will execute the selected statements. Sometimes you will have to reselect the statements but eventually MapInfo Pro will keep the statements selected and you can keep on hitting the Enter key on your keyboard. Do this until the Message window shows the final layer number.
------------------------------
Peter Horsbøll Møller
Principal Presales Consultant | Distinguished Engineer
Precisely | Trust in Data
------------------------------
Original Message:
Sent: 03-24-2025 01:05
From: Alexis Ha
Subject: How to Bulk change Label Display for multiple Layers
Hi All,
Is there a way to Bulk change all my label display to a common field (e.g. "Max") in my layers?
I have 100 layers and it takes alot of time to go into each layer just to change the label display to a specific column.

Hope theres a solution for this.
Regards.
Alex
------------------------------
Alexis Ha
Lyall & Associates
Burlington MA
------------------------------