back to top

Binding a Value to a Label via Code in a Creatio Freedom UI Page

In a previous article, I showed how to bind a value to a label on a Creatio classic page. This article will show how to do the same in a Freedom UI page. One thing that is much easier in a Freedom UI page is that you no longer need to add the label directly to the diff of the page in order to add the label itself. The Freedom UI page editor allows you to simply add a label to the page from the toolbox.

Once the label is added, we will need to bind it’s label to an attribute, then to set the value of the label, we’ll simply need to set the value in this attribute.

Add the Attribute to the Page

To add the attribute, locate the viewModelConfigDiff in your page code, if it doesn’t already have an “attributes” node you’ll need to also add that. Our attribute is called UsrMyLabelCaption. The page code would look like the below. Note: If there is already a node for path attributes, you can just add your new attribute to the values of that existing node.

viewModelConfigDiff: /**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/[
	{
		"operation": "merge",
		"path": [
			"attributes"
		],
		"values": {
			"UsrMyLabelCaption": {}
		}
	}
]/**SCHEMA_VIEW_MODEL_CONFIG_DIFF*/,

Bind the Attribute to the Label’s Caption

Now, to bind the attribute to the label’s caption, I’ll need to add the following to the label (note the $ before the attribute name):

"caption": "$UsrMyLabelCaption"

Note, prefixing the attribute name with a “$” is the equivalent to “bindTo” on classic Creatio pages. The complete label would look as follows:

{
	"operation": "insert",
	"name": "Label_ymx7vqp",
	"values": {
		"layoutConfig": {
			"column": 2,
			"row": 3,
			"colSpan": 1,
			"rowSpan": 1
		},
		"type": "crt.Label",
		"caption": "$UsrMyLabelCaption",
		"labelType": "headline-1-small",
		"labelThickness": "default",
		"labelEllipsis": false,
		"labelColor": "auto",
		"labelBackgroundColor": "transparent",
		"labelTextAlign": "start",
		"visible": true
	},
	"parentName": "AccountInfoFieldsContainer",
	"propertyName": "items",
	"index": 5
}

Set a Value to the Attribute to Show as the Label’s Caption

Anytime we want to set a value to the Label, all we need to do is set the value of our attribute.

request.$context.UsrMyLabelCaption = "Some value for my label";

Since the label’s caption is bound to the attribute, it will update to display the attributes value anytime it changes.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Ryan Farley
Ryan Farleyhttps://customerfx.com/article/author/ryanfarley/
Ryan Farley is the Director of Development for Customer FX and creator of slxdeveloper.com. He's been blogging regularly about SalesLogix, now Infor CRM, since 2001 and believes in sharing with the community. His new passion for CRM is Creatio, formerly bpm'online. He loves C#, Javascript, web development, open source, and Linux. He also loves his hobby as an amateur filmmaker.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Using the AI Prompt to Create Dynamic Folders in Creatio

Using Creatio's AI prompt to create the filter for a dynamic folder works best if you specifically ask for that, and if you are as clear and direct as possible about the filtering, conditions.

Related Articles

AI Readiness Checklist for CRM Teams: Is Your CRM System Ready for AI?

Before using AI in Creatio, make sure your CRM data, users, processes, and automation foundation are ready. Use this practical AI readiness checklist for CRM teams.

Build Your Creatio AI Skills with the 2026 AI Summer Program

Join Creatio’s free 2026 AI Summer Program to learn how to identify, build, deploy, and manage AI agents.

Creatio 10x Is Coming: Join the Webinar to Explore the Future of AI-Native CRM

Learn what's new in Creatio 10x and how AI-native CRM, agentic AI, and no-code automation are shaping the future of customer relationship management. Join the upcoming webinar and discover what's next.

Creatio Unlimited Pricing Explained: AI Packages, Costs, Pros & Cons

Learn what Creatio’s new Unlimited pricing model includes, what it doesn’t include, how AI Action packages work, and the pros and cons for businesses evaluating Creatio.

Related Videos