This topic is locked

Look Up Wizard List Display Values

9/29/2025 23:31:47
PHPRunner General questions
J
jacktonghk authorDevClub member

I have an option field which represents 'Yes' and 'No', the actual value stored in the database is '0' and '1'. Is is possible to use list value to display 'YES', 'No' in the selecttion or View instead of '0', '1'? Thanks.

ChatGPT 9/29/2025

Yes, in PHPRunner, you can easily map the stored values ('0' and '1') to display more user-friendly options like 'Yes' and 'No'. Here’s how you can do it:

  1. Open your PHPRunner project: Launch PHPRunner and open the project that contains the field you want to modify.


  2. Navigate to the Fields tab: Go to the "Fields" section of your relevant table.


  3. Select the option field: Find the field that corresponds to your 'Yes'/'No' values (which stores '0' and '1').


  4. Set up the list values:

    • In the field settings, look for the "Edit format" section.
    • Change the "Edit type" to "Lookup wizard".
    • In the Lookup settings, you can specify the values:
      • Value: Enter 0
      • Display: Enter No
      • Add another entry:
      • Value: Enter 1
      • Display: Enter Yes




  5. Display settings: Make sure to configure the display settings for the list value so that it shows 'Yes' and 'No' in your forms and views.


  6. Save and build your project: After making the changes, save your settings and rebuild your project to apply the changes.


  7. Test the output: Preview your application to ensure that the field now displays 'Yes' and 'No' instead of '0' and '1'.



By following these steps, you can map the stored values to more user-friendly text in PHPRunner, improving the user experience for anyone interacting with your application.

J
jacktonghk authorDevClub member 9/30/2025

There is no way for me to enter value and display separately

img alt

G
Grdimitris 9/30/2025

Go to fields click properties of option field and click the view tab. Choose Custom and write this if ($value==1) $value='Yes'; else $value='No';
Now in view and list page you have Yes and No for values

G
Grdimitris 9/30/2025

If you want and in add or edit pages then create a table named yesno with 2 fields
CREATE TABLE yesno (
id int NOT NULL,
yesno varchar(3) NOT NULL
);
and add these values insert into yesno (id,yesno) VALUES (0,"No"),(1,"Yes");
Then go to fields click properties of option field and click in edit tab the Lookup wizard. For table select yesno, Link field the id, Display field the yesno. And this is it. In add,edit,list,view pages is Yes, No

J
jacktonghk authorDevClub member 10/2/2025

I used to create a database table to handle it, just curious if this can also be acheived with llist value. It is because sometimes I only have one to two fields require yes/no option, I don't want to create a table.

G
Grdimitris 10/2/2025

Is the best way. PHPRunnner already has the utility. Otherwise you have το create javascript functions every time you want yes/no.