Forums

Dynamic data from REST service

ladyj 23 Jan, 2018
Hi,

is it possible to write a plugin or a new kind of dropdown field which loads options with a call to a REST/SOAP web service?
I can write new fields and actions, but I don't know if is it possibile to integrate in chronoforms a new type of dynamic data different from "records from a table".

Thank you in advance.

Regards
GreyHead 23 Jan, 2018
Hi ladyj,

You can use a Custom Code action to run pretty much any PHP that you need - that includes calls to remote services.

Bob
ladyj 23 Jan, 2018
Hi,

I need to dynamically populate options for a dropdown field just before display form in front-end (using a REST service).
As I read from your reply, I can write a Custom Action with which change (add) options of a dropdown field. Is it correct?
GreyHead 24 Jan, 2018
HI ladyj,

Yes.

Your custom code will need to build an array of value + text entries in the $form->data array, then you can use the Dynamic settings in the drop-down to show those entries. Please see the Dynamic Data List section in this FAQ

Bob
This topic is locked and no more replies can be posted.