Execute php script
You have ability trigger or automatically trigger on new record save an external API call to a 3rd party service using the record data. In Action type select "Execute php script":
To get a value from the current record, use the [field id], for example:
$name = [272]; $est_time = [277];
If you need to save the returned data to the fields on the record, then you can do it via mysql query, for example:
db_query("update app_entity_28 set field_277='100' where id={$item_id}");
$item_id
- is current item ID that updated during process action run.
update_by_id
To update fields like Status and apply email rules after update use internal function items::update_by_id($entity_id, $item_id, $data)
See full example bellow
$entity_id = 21; //get entity ID $item_id = [id]; //get current item ID //prepare data to update $data = [ 'field_157' => 38, //change status 'created_by' => 20 //change created user ]; //run item update by id items::update_by_id($entity_id,$item_id,$data);
Insert Record
To insert record use internal function items::insert($entity_id, $data)
$entity_id = 22; //get entity ID $parent_item_id=0; //prepare data to insert $data = [ 'parent_item_id'=>$parent_item_id, 'field_167' => '45,42', 'field_168' => 'New Task 3', //item name 'field_169' => 47, 'created_by' => 1 ]; //run item insert action items::insert($entity_id,$data);
Delete
To delete record use next function items::delete($entities_id, $items_id)
$entities_id = 21; $items_id = 3; items::delete($entities_id, $items_id);
Display custom message
if(is_object($alerts)) { $alerts->add("Can't connect to service","error"); }