Skip to main content
Solved

Can we use reference data in case statement in Computed content?

  • April 9, 2025
  • 7 replies
  • 61 views

Forum|alt.badge.img

Can we add reference data in case statement in Computed content?

Best answer by anna.spakova

Hi, apologies for the delay.

The Lists of values are covered by our documentation:Ā https://docs.ataccama.com/one/15.1.0/metadata-model/lists-of-values.htmlĀ It’s basically just a space from which you can add new values to your custom entities - the main goal for those is to serve as small lookups for drop-down properties in other entities. But you can have multiple properties in those value list entities and you can also populate them via API. In general, you can use any custom entity for a drop-down, this is just a pre-builtĀ example of how it can be done.

Since those lists are entities within the metadata model, they are reachable by the computed content.

Kind regards,

Anna

7 replies

anna.spakova
Ataccamer
Forum|alt.badge.img+3
  • Ataccamer
  • April 14, 2025

Hi ​@sumishaĀ ,

Ā 

can you please elaborate a bit more on your usecase? The computed content is limited to the content of the mmm database, which means that it can only work with the metadata inside.

Kind regards,

Anna


Forum|alt.badge.img
  • Author
  • Data Pioneer
  • April 14, 2025

HI Anna, I have a table defined in One dataĀ 

Ā 

I want to use this in my case statement in Context to get value in attribute field. LIke where sensitivity is PII, mark as confidential. List is very long, so I don;t want to hard code in case. Rather use this One data table or any other reference table here

Ā 


Forum|alt.badge.img
  • Author
  • Data Pioneer
  • April 14, 2025

My computed content looks like this:Ā 

Ā 

Ā with
Ā  Ā  connection_query asĀ 
Ā  Ā (select att.$attId$ Ā  as term_instance_id,
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  ti.$tiFrom$ as "term_instance_from",
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  t.$tName$ Ā  as "displayName",
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  att.$attPath$ as "tiPath"
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā from $att$ att
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā inner join $ti$ ti on Ā att.$attId$ = ti.$tiParentId$
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā inner join $t$ t on ti.target_ri = t.$tId$ and
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā (ti.target_rh is null or ti.target_rh = t.to_h)
Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  Ā  join "_MmdDictionary" d on ti.$tiPath$ = d.id and d.name like '%/termInstances')
select j.term_instance_id as "id_i",
Ā  Ā  Ā  Ā j.term_instance_from as "from_h",
Ā  Ā  Ā  Ā $path("tiPath")$ as "path_i",
Ā  Ā  Ā  Ā $type()$ as "type_i",
Ā  Ā  Ā  Ā j.term_instance_id as "parent_id_i",

Ā caseĀ 
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='DateOfBirth' then 'PII'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='EmailAddress' Ā then 'PII'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='FirstName' Ā then 'PII'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='Mobile' then 'PII'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='Landline' then 'PII'
Ā  Ā  Ā  Ā  Ā  Ā else ''
Ā  Ā  Ā  Ā  Ā  Ā end as "sensitivity",
Ā  Ā  Ā  Ā  Ā caseĀ 
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='DateOfBirth' then '4 - High'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='EmailAddress' Ā then '4 - High'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='FirstName' Ā then '4 - High'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='Mobile' then '4 - High'
Ā  Ā  Ā  Ā  Ā  Ā when j."displayName"='Landline' then '4 - High'
Ā  Ā  Ā  Ā  Ā  Ā else ''
Ā  Ā  Ā  Ā  Ā  Ā end as "risk"
from connection_query j


anna.spakova
Ataccamer
Forum|alt.badge.img+3
  • Ataccamer
  • April 14, 2025

Hi ​@sumishaĀ ,

I understand your usecase, but this isn’t supported to my knowledge. ONE Data is a completely different module that is separated from the mmm backend database, thus it cannot see itsĀ values. I am thinking that maybe the Lists of valuesĀ could be able to help you here instead of ONE Data but that has very limited functionality (no DQ monitoring etc.)

Also an alternative solution could be to use the orchestration server for this automation - you can export the ONE Data reference data into some DB and use this export in your workflow, that would populate the field via API. Together with some Notification handler you could potentially be able to make it ā€œnear real timeā€ as well.

https://docs.ataccama.com/runtime-server/latest/workflow-and-scheduler/notifications-handler.html

Kind regards,

Anna


Forum|alt.badge.img
  • Author
  • Data Pioneer
  • April 14, 2025

Thanks for getting back. Can you share some screen shot of an example of List of values mentioned in first solution?


anna.spakova
Ataccamer
Forum|alt.badge.img+3
  • Ataccamer
  • Answer
  • April 22, 2025

Hi, apologies for the delay.

The Lists of values are covered by our documentation:Ā https://docs.ataccama.com/one/15.1.0/metadata-model/lists-of-values.htmlĀ It’s basically just a space from which you can add new values to your custom entities - the main goal for those is to serve as small lookups for drop-down properties in other entities. But you can have multiple properties in those value list entities and you can also populate them via API. In general, you can use any custom entity for a drop-down, this is just a pre-builtĀ example of how it can be done.

Since those lists are entities within the metadata model, they are reachable by the computed content.

Kind regards,

Anna


Forum|alt.badge.img+1

Hi ​@sumisha, I’m closing this thread for now. If you have any follow up questions please feel free to share them in the comments or create a new post šŸ™‹šŸ»ā€ā™€ļø