Custom App dynamic fields update on value change

I have two fields in my mappable parameters

1. Template Field

This is a select field used to choose a template:

{
  "name": "templateId",
  "type": "select",
  "label": "Select the template",
  "required": true,
  "options": "rpc://templates",
  "dynamic": true
}

2. Modifications Field

The second field should fetch its data from the endpoint:
rpc://modifications


What I want to achieve:

Whenever the template field (templateId) value changes, I want to dynamically call the rpc://modifications endpoint with the selected template value. This means the modifications data should be updated based on the currently selected template.