Question

Write multi-line Definition property with Metadata Writer

  • 3 April 2024
  • 7 replies
  • 46 views

Userlevel 4
Badge +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


7 replies

Userlevel 3
Badge +2

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! 

Userlevel 4
Badge +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

Badge +1

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

Userlevel 4
Badge +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.'.

Userlevel 3
Badge +2

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!

 

 

Userlevel 4
Badge +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.

 

Userlevel 4
Badge +4

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

Reply