1. Fabrik 3.9 has been released. If you have updated Joomla to 3.9, this is a required update.
    Dismiss Notice

concatenate 3 values of different fields and display them in a different field

Discussion in 'Community' started by rickj72, May 4, 2021.

  1. rickj72

    rickj72 New Member

    Level: Community
    hi, I have three fields in my list and I would like to display them in a different field together in the same list, I have tried with both element calc and databasejon, using the wiki examples, with calc elements when I insert return '{table_name___element1}'. '{table_name ___ element2}' return '{table_name___element1}'. '{table_name___element3}'; i have error 500, instead with databasejon element, i get as result a simple text string with the values i wrote as suggested in the tips, i tried to modify anything, i read wikis and i couldn't solve, fabrik versions joomla 3.7 and 3.7.5 with php 5.6, can anyone suggest me how to fix it?
     
  2. startpoint

    startpoint Active Member

    Level: Community
    In calc element you can have only one return.
    In your example code i think you have error because you have syntax error - before second return you need to have ';'.
    But you can have concantenate only element1 and element2.
    Need to rearange your code.
    For databasejoin element you need to show your code to resolve it.
     
    Last edited: May 4, 2021
    troester likes this.
  3. rickj72

    rickj72 New Member

    Level: Community
    return '{table_name___element1}'. '{table_name ___ element2}' .'{table_name___element1}'. '{table_name___element3}';

    i'm sorry, this is my correct code, and i have error
     
  4. troester

    troester Well-Known Member Staff Member

    Level: Community
    This is totally outdated (but should not matter in this case).
    What is your real code and where did you put it (screenshot)?
     
  5. rickj72

    rickj72 New Member

    Level: Community
    in allegato ...
     

    Attached Files:

  6. troester

    troester Well-Known Member Staff Member

    Level: Community
    It's looking ok.
    What happens if you are using a hardcoded value?
    return '123';
     
  7. rickj72

    rickj72 New Member

    Level: Community
    The same error 500 when I see the details of the card,
    The filters always work and give me a list of cards, but when I enter the card I have this error
     
  8. troester

    troester Well-Known Member Staff Member

    Level: Community
    Ok, then the problem is not the calc element/calc code.

    No idea what's going on on your site.
    Try to disable the calc element, other elements, maybe plugins you are running etc.

    And as I said: your versions are outdated, with security issues...
     
  9. rickj72

    rickj72 New Member

    Level: Community
    I think I understand that for some reason the element calc does not work and gives me an error, if I deactivate calc element everything works normally, I would like to have only the merge of these three fields, if I could also with databasejon, with this element I have no errors , but it doesn't read me the values, can you help me figure out if it's my code error?
     

    Attached Files:

  10. troester

    troester Well-Known Member Staff Member

    Level: Community
  11. rickj72

    rickj72 New Member

    Level: Community
    now I have no errors but only a string with empty values, I cannot understand if it is a syntax problem
     

    Attached Files:

  12. troester

    troester Well-Known Member Staff Member

    Level: Community
    Did you use the correct column names?
    Did you save the record with something selected in your dbjoin?
     
  13. startpoint

    startpoint Active Member

    Level: Community
    Select for Label column 'id' again instead empty.
     
  14. rickj72

    rickj72 New Member

    Level: Community
    maybe I explained myself badly for my final result, when I write the concatenation of these three fields I would already expect the 3 values of the same record in this field as a result, but the databasejon if I do not insert anything and / or save it returns me default only the two separator commas, if instead I go to fill in the field it gives me a long series of concatenated values relating to all the records but I have to select it and insert it record by record about 1000 records, I would like the three concatenated values in the presence of the values of the other 3 fields were already in the new field I created with databasejon .... I don't know if it's clear
     
  15. juuser

    juuser Well-Known Member

    Level: Community
    You can set "Only calc on save" to "No", so you will have the value showing up in list, but it's not recorded on database and therefore this field is not searchable and orderable. If you want it to be written in database, set "Only calc on save" to "Yes" and update the calc field in PhpMyAdmin with a update query. As I understood, you didn't want to edit and save around 1000 records manually :)
     

Share This Page