Populate Pro Forms Select Field Options

I have a function to echo a json.
example: echo get_field_options_json(‘priority’);
front end result: {“high”:“High”,“normal”:“Normal”,“low”:“Low”}

How can i populate a select field with these values?
I have tried to set the select field to dynamic data and then out php value, but I have not had any luck getting the options to load on the front end.
Anyone know how to do this?

Hi there :slight_smile:

The JSON array should be returned, not echoed from your function and also should have value and label properties. Could you post your function for me to take a look and adjust?

Basically instead of {“high”:“High”,“normal”:“Normal”,“low”:“Low”} , it should look more like

[
  {"value":"high","label":"High"},
  {"value":"normal","label":"Normal"},
  {"value":"low","label":"Low"}
]
1 Like