kenticokentico-12kentico-11

Can a variable be used in macro expression?


Can a variable be used like this code in the macro expressions to retrieve values dynamically?

I am trying the code below which return as null.

var indexId = 45;

return CMSContext.Current.GlobalObjects.Users[indexId].DisplayName;

Solution

  • Yes, please see the macro syntax documentation