Tranform int in string

Display text labels instead of numeric status codes.

Overview

The issue occurs when a database table returns numeric status values (0 or 1) instead of descriptive text like "Active" or "Blocked".
Use a switch function in your form, mapping the numeric values to their corresponding text labels, and set the data provider to reference the correct table field.

Answered
ra rafaelscouto 08 Mar, 2018
Good afternoon, how do I turn one value into another?

In my table, I get the status return, which is 0 for active or 1 for locked.

How do I show the name Active or Blocked instead of 0 or 1
Max_admin Max_admin 15 Mar, 2018
Answer
Hi Rafael,

Call a switch function, the function values setup should be like this:
1:Active
0:Blocked
The "Data provider" should be set to the table field value: {var:table_name.row.field_name}

Best regards
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.