how to create custom formatters

AnswerIQ
Kilo Contributor

Hi,

I've a table X which has 4 columns as- "case_id", "my_col1", "my_col2", "my_col3". "case_id" is a reference to incident table. I want to have a formatter on incident table such that it populates rows from table X corresponding to the incident.

What I've done so far: -

  1. I've created a UI Macro script which brings the rows of table X filtered on a hardcoded incident. I've previewed it and results coming are as expected.
  2. I've created a UI Formatter corresponding to the UI Macro above.
  3. I've configured the formatter to incident in form design.

Problems I'm facing: -

  1. I'm not seeing the results of formatter on incident table like we see for activity formatter.
  2. Once I start seeing the results for the current setup, I don't know how to pass the incident details dynamically to the Macro instead of hardcoding.

 

Regards,
-Rakshit

2 REPLIES 2

Phuong Nguyen
Kilo Guru

Hi AnswerIQ,

Please share screenshot of your UI Macro. But a few questions in mind, does the macro needs to be cached or not? this will translate to whether or not we need to run scripts in phase 2. You can access the current object in phase 2 like this $[current.sys_id]. What is the purpose of the macro? is it going to be a form user can fill out? or just to display data? etc..

Thanks,

Phuong

Hi Phuong,

 

Thank you very much for a prompt response.

Caching the macro is not an immediate necessity. I'm fine going ahead using whichever method is convenient.

I'll try $[current.sys_id] if that solves the purpose once I'm able to see the formatter results on incident table.

Purpose of the macro currently is display only.

I'll clean up the business logic and attach a screenshot of a simplistic macro.

 

Thanks,

-Rakshit