Dynamic Help Text
Dynamic Help Text provides real-time feedback and contextual assistance to users—based on live conditions inside your plugin's code. It helps users understand what’s happening, especially when something goes wrong.
Rather than showing static instructions, dynamic help adapts to API responses, user inputs, or edge cases—making your plugin easier to debug and more intuitive to use.
Why Use It?
Guide users when something is misconfigured
Alert when required data (e.g., column headers) is missing
Help users resolve issues instantly
Enhance user experience with real-time suggestions
Example Use Case
Suppose you’re creating an action for Google Sheets to insert a new row. The plugin must know what columns exist—but if the selected sheet has no headers, you should notify the user immediately.
How It Works
You can fetch data using an API call, check a condition, and then return either:
A valid field structure
Or a message + empty fields when validation fails
Sample Code
const apiUrl = https://sheets.googleapis.com/v4/spreadsheets/${context.inputData.spreadSheet_id}/values:batchGet?ranges=${context.inputData.sheet_id}!1:1000&valueRenderOption=UNFORMATTED_VALUE; const headers = { Authorization: Bearer ${context.authData.accesstokencode.access_token} }; const response = await axios.get(apiUrl, { headers }); let arrToReturn = []; // ✅ If column headers are found if (response.data?.valueRanges?.[0]?.values?.[0]) { const headers = response.data.valueRanges[0].values[0]; arrToReturn = headers.map(entry => ({ key: entry, label: entry, type: 'string', required: false, help: '' })); } // ❌ If no headers found else { arrToReturn = { children: [], message: 😕 Didn't see any headers in the provided spreadsheet. 🛠 Did you add headers to the spreadsheet? If so, refresh this step to pull in the new data. 🔗 [Click here for instructions on setting up your spreadsheet.](https://viasocket.com/faq) }; } return arrToReturn;
How to Use in viaSocket
Add this code directly in the plugin builder's JavaScript API Call
Or embed it in JSON using the
"source"
key (make sure to escape the code using EscapeJSON before pasting)
Pro Tip
You can use this method in any plugin scenario—like:
Checking authentication validity
Verifying API credentials
Ensuring resources (e.g., project ID, table columns) exist
Alerting for unsupported settings