...
Expand | ||||||
---|---|---|---|---|---|---|
|
Create
Click “ + Add Code” from the Code to open the “Create Create New Service or Library” Library modal.
...
This allows lets you to use the code libraries to build code. Give the code service a one-word name for the system to refer to and click Create.
...
Add code to the window to run.
Pick code libraries to use in your code (log is added by default). Make sure to choose Choose the clearblade library to interact with the ClearBlade platformPlatform.
...
...
3. Edit test parameters.
4. Save and
...
test the code, and the results
...
appear.
5. Turn the log toggle on to keep track of the code results.
...
Debugging
To debug your code service, ClearBlade provides as a simple , but flexible logging facility1. Make sure facility to debug your code service.
1. Ensure the log toggle is on2on.
2. When you create/edit your code service, you can embed log() calls in strategic places strategically to monitor execution progress3progress.
3. You can then run/test the code service. This window should pop up after the service executes: 4it executes.
4. There will be a log list of logs starting with the most recent one to go back to5. Finally, when return to.
5. When you have finished you debugging, and your service is working works perfectly, You you can turn off logging by switching the toggle. You do not have to remove the logs from the code . They just (they become noop statements).
...
Trigger Pane
Add Trigger
Click on “ + Add Trigger”Trigger.
...
Enter a name
Choose whether to enable Enable or disable the trigger
Select a source and action
Click “Create Trigger” Create Trigger when done.
See Trigger Source for a list of sources and actionssource and action list.
Update Trigger
The only items that can be updated in the trigger are : - Whether whether to enable/disable the trigger - The and the items that appear after “Action” an action (such as a collection).
Click “Update Trigger” Update Trigger after making the an edit.
Delete Trigger
...
Click “Delete” Delete on the right of the trigger and click “confirm” confirm when prompted.
Timers Page/Pane
Timers can be created on the Timers page (inside of a system) or the Timers pane (on the Code Service Page).
...
Add the timer information and click “Create Timer” when you are finishedCreate Timer. The timer should be listed in on the “Timers” Timers page.
...
Click on the timer to make updates (you cannot update the name). Make sure to save Save changes by clicking “Update Timer” Update Timer in the window.
Click on “Topic” Topic to copy the timer topic path.
To delete, click on “Delete” Delete on the right of the timer.
Enable/Disable Triggers/Timers
There is an option available to You can disable triggers and timers in the handlers' editing modal of both handlers. It will display ‘Enabled’ Enabled or ‘Disabled’ Disabled under each timer/trigger.
Webhooks
Click ‘ + Add Webhook’ Webhook to add a new webhook. Enter the information in the modal and click ‘Create’Create. The webhook should appear in the list.
The webhook can be deleted by clicking ‘Delete’ Delete to the right of it.
Clicking on the webhook will allow lets you to update the modal’s description and auth method in the modal. Click ‘Update’ Update to update the webhook.
Copy the link to execute the service’s webhook in a service.
...
Delete, Discard, and Save
...
Click “Delete Service” Delete Service, and a prompt will appear to verify deletion.
Click “Discard Changes” Discard Changes to delete changes you made in the session. It will take you back to the homepage without a confirmation prompt.
Click “Save” Save to save changes made to the service.
Libraries
Create library
Click “ + Add Code” from the Code to open the “Create Create New Service or Library” Library modal.
...
Switch to the “Library” Library button. Give the library a one-word name or the system to refer to and a description, and click Create.
...
Library Code Page
Just like code services, you can write your own code. The difference is that you can turn it in to into a library to be able to use in for code services.
You can also add other libraries to your library. Note: Do Do not add the current library to itself.
...
Your new code library will appear at the top in bold in your code service library list.
...
Each library is “required” required from a service itself. Some libraries are not listed by default and need to be added. Libraries that are added later in the list will override earlier ones if they have conflicts arise.