This topic is locked

Get then Change Field Value be showing on List and View Pages.

6/14/2022 12:50:54 AM
PHPRunner General questions
S
Shaun Williams author

I have an issue where an image is being stored in the database but in the wrong format.

I have working code that will take that data and convert to new file type before outputting, but I have no clue and cannot seem to find an answer as to where, and then how I can grab the value, and change it before it is shown in both List and View pages. The place were I would normally do this is as a custom field, but for some reason, I dont have the option to change the field to custom, it only allows image or file field formats.

Sergey Kornilov admin 6/15/2022

View as Custom can't be directly applied to binary fields, but there is a workaround.
Add a calculated field to your SQL query in PHPRunner:

SELECT
...
WMFStream,
'' as WMFStreamConverted,
...

Then use 'View as Custom' with WMFStreamConverted instead of the original field.
You can access any field value in the $data array in the code
I.e. $data["WMFStream"]
https://xlinesoft.com/phprunner/docs/view_as_settings_custom.htm