"MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number

Post Reply
yaoying
Posts: 133
Joined: 10 Apr 2023, 23:23
Name: 耀影
Location: 深圳
Company Name: 深圳市耀影科技有限公司
Contact:

"MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number

Post by yaoying »

"MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number
Attachments
截图_选择区域_20230705162715.png
截图_选择区域_20230705162749.png
截图_选择区域_20230705162846.png
Didou12
Posts: 487
Joined: 14 Jan 2023, 14:53
Name: Louis
Location: Montreal, Canada

Re: "MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number

Post by Didou12 »

It's normal.

It displays the value of the field which is the id parent in the list (top level), and the id.

To get the name of the id value,

use entity_item_value() https://docs.rukovoditel.net/index.php? ... ure_in_3.0

or you can use PHP (with dynamically execution if you don't want to store it in the database)
Using Rukovoditel since 2022 --- v3.4 (with extension) in French on PHP 8.2
I keep the French translation up to date
I'm trying to help you (+10 years experience in html, css, php, sql, JS/jquery, python)
yaoying
Posts: 133
Joined: 10 Apr 2023, 23:23
Name: 耀影
Location: 深圳
Company Name: 深圳市耀影科技有限公司
Contact:

Re: "MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number

Post by yaoying »

How does the field type "MySQL query" get the "Multilevel Dropdown" field value?

"MySQL Formula" uses 'use entity_item_value()' incorrectly?
Attachments
截图_选择区域_20230706122237.png
截图_选择区域_20230706122245.png
截图_选择区域_20230706122000.png
截图_选择区域_20230706122023.png
shandybt
Posts: 53
Joined: 29 Jul 2016, 12:31
Name: Shandy Banyutresna
Location: Indonesia, Jakarta
Company Name: PT. Kimia Farma
Contact:

Re: "MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number

Post by shandybt »

i have same issue

any solution
enishemed
Posts: 651
Joined: 30 Oct 2017, 11:24
Name: Enis Hemedoglu
Location: Istanbul, Turkey
Company Name: SCORE DANISMANLIK
Contact:

Re: "MySQL query" Query the "Multilevel Dropdown" value of the current record, display the number

Post by enishemed »

I think you are using the formula in the wrong way.

It should be something like this.

Let say we have two entities.

Projects (entity id 21), fields:
  • 1. Name, input field ,
    2. Status, dropdown field,
    3. Start date, date field,
    4. End date, date field
Customers (entity id 22), fields:
  • 10. Customer name, input field,
    11. Address, input field,
    12. Customer type, dropdown field,
    13. Project, entity field, (Project Entity selected)
    14. Project Status, Mysql Formula Field
Here, in mysql formula field, the code should be like this:

Code: Select all

entity_item_value(13,2)
Be careful, the id of the entity is 21, but in entity_item_value() function, I use the 13 (not 21), because
n Customer Entity, I use an entity field (using project entity) and the id of entity field is 13.
Post Reply