UI Builder: Property Value Based on Repeated Data Resource

TFischer
Tera Expert

Hello,

 

I am using a repeater to render a list of alerts based on a data resource. Is there a way to conditionally render the value or a property based on the value of the data resource index? 

 

For example, my list of links may include records of many different task-extended tables and I want to render different text dependent on the table. So for an alert on RITM record I would want to render "There is a new request", while if the record was an INC I would want to see "There is a new incident".

 

I am iterating the data resource and creating alerts as intended, I'm just not sure of how to reference each data resource "row" when configuring the label property.

 

TFischer_0-1736525655990.png

 

 

 

Thanks.

1 ACCEPTED SOLUTION

Kevin83
ServiceNow Employee
ServiceNow Employee

You could process the data coming back from your data broker in a script.

So on Data broker fetch succeeded you could transform the data into any shape you need, and assign that to a state variable.

something like this:

Screenshot 2025-01-10 at 12.24.55 PM.png

 

Screenshot 2025-01-10 at 12.24.42 PM.png

View solution in original post

1 REPLY 1

Kevin83
ServiceNow Employee
ServiceNow Employee

You could process the data coming back from your data broker in a script.

So on Data broker fetch succeeded you could transform the data into any shape you need, and assign that to a state variable.

something like this:

Screenshot 2025-01-10 at 12.24.55 PM.png

 

Screenshot 2025-01-10 at 12.24.42 PM.png