Trying to index pages for Content Delivery API
# help-with-umbraco
j
I am trying to create a custom filter for indexing pages that has tags (pages) with a property "urlName". The tags are my custom content types, not the Umbraco ones. When I am running the rebuild index I hit the code as expected, but when I try to extract the "urlName" property value I get exceptions as in the image. I guess I am doing something completely wrong here, I would be very thankful if someone has an idea to point me in the right direction. https://cdn.discordapp.com/attachments/1227215161035722804/1227215161258147870/image.png?ex=6627982e&is=6615232e&hm=a9932146583e1a2faa7adc91338eb7437964093b7240f18ab483ef649f66d079&
m
Did you manage to solve this? Just looking at the code and was wondering what would happen if you used the base IPublishedContent case as a start and sourcePage.Value and tag.Value to find the properties by alias to see what happens? I am assuming that Tag is also an IPublishedContent (from a content picker?) So maybe var sourcePage = cache?.getById(content.id); // which will be IPublishedContent then var tags = sourcePage.Value<IEnumerable>("tags"); then iterate each tag to get the Value of the alias "urlName". maybe? Just wondering if something is happening with the castings