Demo to preview the settings
Introduction
This free plugin is a list of tools for working with bubbles. It enables you to Run JavaScript code as well as Generate JSON objects with relevant data for doing an easy search inside your DataBase.
Imagine you have an app with stores and you'd like to find orders made in them in a radius of 100 km. This plugin helps lightly filter the information you need by keyword and location. Additionally, it helps you to capture errors from the console logs from your app.
INSTRUCTIONS:
The plugin comes with four elements: CustomJS, Search, Error Capture, and Parse XML.
- Use the Custom JS element and its action "Run js CustomJS" to initialize your custom javascript.
- Use the second element- Search and its action "Get Data From a Search" for a search for values by a given key from the database and generate a JSON file. With an extended action filter and you can find any information, you need from the database table.
- Use the third element - Error Capture to capture errors from the console in your app.
- Use "Parse XML" element to display the XML content into Repeating Group.
How to setup
The plugin comes with four elements: CustomJS, Search, Error Capture, and Parse XML.
Custom JS element.
This element initializes your custom javascript.
Actions
Fields
Title | Description |
Return a list | If you want to return a list in the states, enable the checkbox |
Code js | When you want a state to be returned it is necessary to call the function "zeroQodeExportDateinState function (ValuForState)". |
Events
Event name | Triggered when |
Custom JS Completed | This event is triggered when JS has run successfully. |
Custom JS Error | This event is triggered when your script returned an error. |
Exposed states
State title | State value |
Return your value | if you returned a single value, it will be contained here. |
Return your list with values | if you returned a list of values, it will be contained here. |
Search element
This element is used for a search for values by a given key from the database on the backend side and generates a JSON file.
Fileds:
Title | Description |
Type of Content | Set here the data type that belongs to the plugin (Bubble search result). |
Actions
Get Data from Search - it is an action that will return data from the database according to the constraints that will be set by you.
Title | Description |
Object Type | select the object you want to search |
Selected fields | write the name of the fields you want to receive. |
Key | This is the name of the field to which the constraint applies. You can also use the reserved key _all for full-text database searches. |
Constraint_type | This is the type of constraint you want to apply. It can be:
1. equals or not equal use to test strict equality, for all field types.
2. is_empty or is_not_empty use to test whether a thing's given field is empty or not, for all field types.
3. text contains or not text contains Use to test whether a text field contains a string, for text fields only.
4. greater than or less than use to compare a thing's field value relative to a string or number, for text, number, and date fields.
5. in or not in use to test whether a thing's field is in a list or not, for all field types.
6. contains or not contains Use to test whether a list field contains an entry or not, for list fields only.
7. empty or not empty use to test whether a list field is empty or not, for list fields only.
8. geographic_search Use to test if the current thing is within a radius from a central address. To use this, the value sent with the constraint must have an address and a range. |
Value | This is the value against which the constraint should be compared. This can be a string, a number, a list, and so on, depending on the type of field defined by the key in the current constraint. If the value type is invalid, Bubble returns a 400, "INVALID_DATA" error. The value must be at least 5 characters.A particular case of a key of type address and a constraint_type set to geographic_search, the value should be an object with the following keys |
Origin_address | The central address that defines the center of the search, should be a string address. |
Range | The range of the radius, is defined in miles or kilometers, depending on the unit. |
Unit | The unit to use for the search. It can be miles (default) or km.
Constraints with an undefined value are ignored. Do not use '_id' as a key for a constraint. Instead, use the call that retrieves a thing by ID.
You can control how the list is sorted using two parameters: sort_field and descending |
Sort field | Specify the field to use for sorting. |
Descending | This parameter can either be true or false (default). |
Download JSON | enable checkbox if you want to download the JSON file. |
File Name | JSON file name |
Eхposes States
State title | State value |
Result | Contains lists of data grouped by user-defined field names.
For instance, If you set the Selected fields to be Types, description, geographic_search, number then in the Result Bubble Object state, you'll have access to the aforementioned fields in this fashion: field1 to get Types, field2 for description, and so on ...
Each of these fields is a list of values from your Bubble object. So, field1 # 1 is the first name item from your Bubble object, field1 # 2 is the second one, and so on ... |
ㅤ | ㅤ |
Parse XML
This element will help you to display the XML template in a repeat group.
Actions
Convert Parse XML- this action will help you display an XML in the Repeating Group.
Fields
Title | Description |
XML Content | enter the XML content. |
Selected fields | select the fields you want to get from XML. |
Exposes States
State Title | State Value |
Result | Contains lists of data grouped by user-defined field names. For instance, If you set the Selected fields to be, then, in the Result Bubble Object state, you'll have access to the aforementioned fields in this fashion: field1 to get name, field2 for price, and so on ...
Each of these fields is a list of values from your XML. So, field1 # 1 is the first name item from your XML, field1 # 2 is the second one, and so on ... |
Send XML/JSON data to API backend workflows
If you need to save a JSON or XML to the database, create "backend workflows in the API", setting in the action of the URL plug that leads to endpoints created on the backend and the XML / JSON content
After the call has been successfully initialized, delete the word initialize.