Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

How can binding data with template card UI builder

Fabrizio Joaqui
Mega Guru

Hi, i have to binding data in the template card, i already have a repeater with the array:

FabrizioJoaqui_0-1666080488298.pngFabrizioJoaqui_1-1666080529138.png

and i have to binding this data in the template card, for example name in the heading label:

FabrizioJoaqui_2-1666080617106.png

i tried to do this, but i doesn't works:

FabrizioJoaqui_4-1666080714333.png

 

 

1 REPLY 1

AijaRe
Kilo Sage

Two years later, I had the same doubt 🙂 Maybe it will help someone who comes across this post as I did.
Also didn't manage to pull in data with data-binding, but solved this issue by using script possibility within data-binding.

AijaRe_0-1728639284877.png

In your case the script would probably look like so:

 

/**
  * @Param {params} params
  * @Param {api} params.api
  * @Param {TransformApiHelpers} params.helpers
  */
function evaluateProperty({api, helpers}) {
	 var hd = { label: api.data.look_up_records_1.results[0].name.displayValue, level:3 };
  return hd;
}

 

If you pull data from a repeater component, it would start with 

var hd = { label: api.item.value..... }