Skip to main content
Solved

Write multi-line Definition property with Metadata Writer


Albert de Ruiter
Star Blazer L2
Forum|alt.badge.img+4

Hi Community,

The purpose of the follwing scenario is to update multiple term names and definitions. I have created a plan that writes the terms names, definitions and GID to a csv file. In that file I can make updates on the names and definitions. With another plan I read that file and write it back into Ataccama.

That works well, except in the following case. The text in the Definition can be entered on multiple lines by using the Enter button. So OneWeb will show:

Text on line 1.
Text on line 2.
Text on line 3.

In the export (the csv file) the text will look like this:

"[{""type"":""paragraph"",""children"":[{""text"":""Text on line 1.""}]},{""type"":""paragraph"",""children"":[{""text"":""Text on line 2}]},{""type"":""paragraph"",""children"":[{""text"":""Text on line 3}]}]"

If you import the text like this, the content will not appear on 3 lines, but literally as above and on one line.

How can I import the text so it is on 3 lines again?

Thanks for any suggestion.

Kind regards,

Albert

Best answer by Albert de Ruiter

Hi all,

Also with the aid of Ataccama Support there is no real solution available. Meanwhile I have created a component that I use for instance when exporting glossary details (the business definition field mainly). The component does most of the job, but it isn't flawless. Sometimes still clutter appears, so based on that some further cleaning steps can be defined. 

Frankly not all cleansing requirements are straightforward: basically I want to get rid of the json-like formats that are added in the output, but also formatting options like italic/bold text, or bulleting will lead to ‘garbage’ in the export. But then, how can you keep that formatting in an export to either a text file or a database table? 

Regarding the component, the approach is quite basic (or ugly, actually), simply replacing unwanted strings by an empty string. I have choses a multi-step approach in order to keep the component understandable, because if you nest all steps the logic becomes quite unreadable. 

So if anyone has a better idea, please share 😉

With respect to the attachment, a component file could not be uploaded so I renamed the file extension. Rename back to ‘comp’and you can use it in Desktop again.

Kind regards,

Albert

View original
Did this topic help you find an answer to your question?

9 replies

Forum|alt.badge.img+3
  • Ataccamer
  • 17 replies
  • April 3, 2024

Hi @Albert de Ruiter! You can alter term definitions using a Column Assigner step to include the newline character \n to indicate a new line. For example, "Text on line 1. \nText on line 2. \nText on line 3. \n" will separate each sentence onto a newline. Hope this helps! 


Albert de Ruiter
Star Blazer L2
Forum|alt.badge.img+4

Hi @joyce ,

Thanks for thinking along. Actually I had already tried to use the \n in the input file, as replacement of the "[{""type"":""paragraph"… etc. But then the \n is not recognized as a newline character by the Metadata Writer. Do you have a clue?

Kind regards,

Albert


Forum|alt.badge.img+1
  • Data Enthusiast
  • 6 replies
  • April 4, 2024

I use  replace(AttributeDescription, "\l\n"," ")  in a similar case where I needed to delete the CR/LF from an attribute discription. After that the csv could properly be imported


Albert de Ruiter
Star Blazer L2
Forum|alt.badge.img+4

Hi Daan, actually the idea is to keep the linefeeds in the Definition field of the term!

So the question is, when I use a csv file as input in a desktop plan as follows

and using a Metadata Writer to import the data back into Ataccama

in OneWeb how do I get the definition to show on 3 lines separately, like

But with ‘Text on line 1. \n Text on line 2. \n Text on line 3.’ in the csv file in OneWeb the definition content remains the same, so again ‘Text on line 1. \n Text on line 2. \n Text on line 3.'.


Forum|alt.badge.img+3
  • Ataccamer
  • 17 replies
  • April 4, 2024

Hi @Albert de Ruiter, I’ve created a plan which imports ABC Term and a description with newlines. In the ONE Web App, each description line populates onto a newline.

If this doesn’t work for you, could you verify that the description is correct (with the proper newline characters) before the ONE Metadata Writer step? Along with a screenshot of the ONE Web App term description that’s populated after the plan is run? Thanks!

 

 


Albert de Ruiter
Star Blazer L2
Forum|alt.badge.img+4

Hi @joyce, thanks for your example. I can recreate this successfully on my side, but my scenario is a bit different with respect to the input of data. As input for the plan I have a csv file that contains many updates to be executed via the Metadata writer step. In your example the data input is manually in the Alter format, so that approach won't work for me. I have tried to include your setup in my scenario as follows, but unfortunately the definition content is still on 1 line.

 


Albert de Ruiter
Star Blazer L2
Forum|alt.badge.img+4

I have now also raised this question at Ataccama Support. I will share the outcome in this post.


Albert de Ruiter
Star Blazer L2
Forum|alt.badge.img+4

Hi all,

Also with the aid of Ataccama Support there is no real solution available. Meanwhile I have created a component that I use for instance when exporting glossary details (the business definition field mainly). The component does most of the job, but it isn't flawless. Sometimes still clutter appears, so based on that some further cleaning steps can be defined. 

Frankly not all cleansing requirements are straightforward: basically I want to get rid of the json-like formats that are added in the output, but also formatting options like italic/bold text, or bulleting will lead to ‘garbage’ in the export. But then, how can you keep that formatting in an export to either a text file or a database table? 

Regarding the component, the approach is quite basic (or ugly, actually), simply replacing unwanted strings by an empty string. I have choses a multi-step approach in order to keep the component understandable, because if you nest all steps the logic becomes quite unreadable. 

So if anyone has a better idea, please share 😉

With respect to the attachment, a component file could not be uploaded so I renamed the file extension. Rename back to ‘comp’and you can use it in Desktop again.

Kind regards,

Albert


Cansu
Community Manager
Forum|alt.badge.img+3
  • Community Manager
  • 625 replies
  • March 31, 2025

Thank you for sharing an update here ​@Albert de Ruiter 🙌


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings