Forums

concat problem

Fredolino 07 Jan, 2020
Hi,
I have a read_data function and in the fields to retrieve:
CONCAT(art , ', ' , gattung, ', ', autor)
This is ok with 3 table-fields.

But just i have a one more table-field:
CONCAT(art , ', ' , gattung, ', ', autor, ', ', artname_de)

One more table-field make a problem. But wat is the problem?

F.
healyhatman 07 Jan, 2020
Make sure you have the spaces around the commas.
Fredolino 07 Jan, 2020
ok...
CONCAT(art , ' , ' , gattung , ' , ' , autor)  this give me correct
CONCAT(art , ' , ' , gattung , ' , ' , Autor, ' , ' , artname_de) this give me the error:
1583 Incorrect parameters in the call to native function 'concat'     

for ex. i have in CC6 this:
CONCAT(Artname.art , ', ' , Artname.gattung , ', ', Artname.autor , '  ', artname_de)
and i have not a problem...
healyhatman 07 Jan, 2020
Do the same thing then. Model.fieldname
Fredolino 07 Jan, 2020
I've already tested that. Unfortunately did not work in CF 6.
Fredolino 07 Jan, 2020
CONCAT(art , ' , ' , gattung , ' , ' , autor , '  ' , artname_de)

I have now tested the concetination with all field names in the table and the correct result was displayed.
The problem only occurs when I want to display data from the "artname_de" column.
There are also empty lines in the "artname_de" column. Concat probably cannot display this in CF6.

I tested the same table with Concat in the CC 6 and there are no problems.
healyhatman 07 Jan, 2020
Need the but at the end. Concat(....):model.alias with alias being what you want the new column to be called
Fredolino 09 Jan, 2020
I also tried the "alias" and there was no success.
I also tried square and round brackets.
Thats how it works:
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , art)
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , autor)
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , gattung)

and this not:
read_data29:
order fields: art_nr = Ascending
retrieve:
art_id
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , artname_de)
art_nr

Dropdown:
name: group[{var:area_repeater2.key}][art_id]
options:
= Art auswählen
{var:read_data29}
healyhatman 09 Jan, 2020
Screenshot your read data action
Fredolino 13 Jan, 2020
Hi,
So it works like in the screen (view and action).
I want to expand read_data29 with the data from the database "artnamen_de" and it just doesn't work.
I also tried the "alias" and there was no success.
I also tried square and round brackets.

Thats tests how it works:
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , art)
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , autor)
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , gattung)

and this not:
read_data29:
order fields: art_nr = Ascending
retrieve:
art_id
CONCAT(art , ' ' , autor,', ' , gattung , ' ' , artname_de)
art_nr








healyhatman 13 Jan, 2020
You have it set to return an array of key/value pairs, but you're requesting 3 fields.
Fredolino 13 Jan, 2020
i do not understand that.

Why does that work, for example:
CONCAT (art, '', autor, ',', gattung, '', gattung)

and that doesn't work
CONCAT (art, '', autor, ',', gattung, '', artname_de)
healyhatman 14 Jan, 2020
Just send me access details we're going around in circles. Include in your message exactly what fields you're trying to concatenate
Fredolino 16 Jan, 2020
I don't know why, but here's how it works:

art_id
CONCAT(artname_de , ' ' , gattung , ' ' , art , ' ' , Autor)
art_nr

Does a line break also work in CONCAT?
After "artname_de" I wanted to insert a line break for a better overview.
Fredolino 16 Jan, 2020
CONCAT(artname_de , '<br> ' , gattung , ' ' , art , ' ' , Autor)
Work not. CF Editor delete this.
healyhatman 16 Jan, 2020
Try \n

But I don't know why it would remove it
Fredolino 17 Jan, 2020
That does not work either.
I don't think HTML is allowed in option tags, so it's filtered out.

It is only possible in combination with JS, since the text is then exchanged in the DIV.
(http://jsfiddle.net/t0xicCode/454Lqbz8/embedded/result,css,html,js)
But this is not possible with ChronoForms, since you only have value and text.

I don't know how ChronoForms builds the divs for the Select.
If it works with jQuery, all you have to do is enter the text with the breaks in the data content and you have multiple lines.
healyhatman 17 Jan, 2020
Answer
Ohhh you wanted it in the dropdown? Yeah nope. You'd have to build it with PHP instead of using the field.
This topic is locked and no more replies can be posted.