Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi! Spent a lot of time searching for this...
I have a product page, and am using a Umbraco.ContentPicker2 for selecting a brand as one of the properties. The data is stored as a UDI, i.e. umb://document/fa06e4e2418545b7afe3694e1f8e7724
Basically, I am looking to create a page with the brand, and all of the products that have the matching UDI in the product record.
Logic being something like
Select [product] where DocumentTypeAlias == "productDetail" && getproperty("productBrand") == [thisUDI]
Extremely sloppy pseudo code, but hope the idea is clear?
You can use UmbracoHelper for getting nodes you need, have a look - https://our.umbraco.com/documentation/reference/querying/umbracohelper/
Be aware with using Descendants method, check out common pitfalls - https://our.umbraco.com/documentation/reference/Common-Pitfalls/
If you need products directly from the database, use content Service - https://our.umbraco.com/documentation/reference/management/services/contentservice/ This method is pretty slow, but if you need the data from the database this is the only way, I don't recommend to use SQL requests.
Try to show us the code you have and structure - we will help you with all community!
Hi Alex, thank you. I am a reasonably accomplished Umbraco dev. My question is more about UDI, not overall querying.
Anyone have an example of how to query a certain docType with property data stored as UDI, getting all those records?
Maybe it is just that I need to know: would I compare them string on string? Seems like a massive step back vs an Id, so there must certainly be something I am missing.
So your goal is to query umbraco for all nodes that pick other nodes by UDI? Is this a one-off report you need to generate? Or do you actually need Umbraco to be able to run this query?
Hi Mark, thank for taking a look here. I do want to query on it, yes. The example is I have a doctype (product) that uses the picker to select another doctype (brand). Umbraco stores as a UDI.
When I am on the brand landing page, I want to reverse the lookup and get all the products with that brand UDI. It would be a real-time page, so like to generate from content/ cache.
Hello all: checking in if anyone in Umbraco-world has experience querying on data stored as umb/UDI.
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted