cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
AndrewA
Level: Powered On

MySql lookup returning no information

GLPI_States.jpg

I don't know what's causing this look up function to fail. I'm trying to pull the name from the glpi_states table and associate it with the states_id value on the glpi_computers table, but it's returning no information.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: MySql lookup returning no information

Hi @AndrewA,

Could you please share a bit more about the id property that you mentioned within your LookUp formula?

 

Is the id a column in your glpi_computers table? Which type of the id column in your glpi_computers table?

Further, could you please share a data structure about your glpi_states table?

Please check if you have typed proper id column within your LookUp function. Please modify your formula as below:

LookUp('[glpi].[glpi_states]', Value(users_id) = Value(ThisItem.id) && users_id <> 0, name)

then check if your issue is solved.

In addition, is there a column called users_id in your glpi_states table? If not, please modify your formula as below:

If(users_id <> 0, LookUp('[glpi].[glpi_states]', id = users_id, name))

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Community Support Team
Community Support Team

Re: MySql lookup returning no information

Hi @AndrewA,

Could you please share a bit more about the id property that you mentioned within your LookUp formula?

 

Is the id a column in your glpi_computers table? Which type of the id column in your glpi_computers table?

Further, could you please share a data structure about your glpi_states table?

Please check if you have typed proper id column within your LookUp function. Please modify your formula as below:

LookUp('[glpi].[glpi_states]', Value(users_id) = Value(ThisItem.id) && users_id <> 0, name)

then check if your issue is solved.

In addition, is there a column called users_id in your glpi_states table? If not, please modify your formula as below:

If(users_id <> 0, LookUp('[glpi].[glpi_states]', id = users_id, name))

Best regards,

Kris

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
AndrewA
Level: Powered On

Re: MySql lookup returning no information

Thank you for taking the time to look at this. I went back to my source data for the glpi_states table and there was a duplicate column in that table that was being referenced instead of the column by the same name in the glpi_computers table. I had thought that the positioning of the column name would indicate that I wanted to specifically reference the table assoicated with the form, but I reread the documentation for the lookup function, and it states that it finds the first record with that column name. Since there was a column with that name in the same table, it was trying to use that. I changed the column name to something else, and it works fine now.

 

Sorry for the long rambling; I haven't had coffee yet Smiley Happy