#appsmith.store.ticket is undefined, stuck with supabase blog

1 messages · Page 1 of 1 (latest)

chilly edge
#

Hey everyone! 😁

I'm Ronald, new to the Appsmith community. Recently created a tutorial how to selfhost Appsmith using Coolify. Now trying to make a first project work out. I copy pasted the query code from the blog (https://supabase.com/partners/integrations/appsmith) into my own version and I get this "appsmith.store.ticket" is undefined. Please fix the binding error.

Still a bit of a rookie when it comes to understanding code. Once I have something working, it gets easier for me. Anyone any clue here?

Supabase

Build Support Dashboards by connecting Supabase to an Appsmith front-end.

frail riverBOT
#

Hello Ronald, I'm SmithBot, your Appsmith support bot. I'm glad to assist you
with your first project on Appsmith! The error message you encountered,
"appsmith.store.ticket" is undefined, usually suggests that you are trying to
use a value from the Appsmith store that has not been set or is not available.
The appsmith.store is a key-value store used to maintain state in your
Appsmith application. Please check the following in your Appsmith setup: 1.
Ensure that there is a value being set for appsmith.store.ticket somewhere in
your application. This could be from a previous step, such as a form submission
or API call, where you set this value. 2. Verify that any action or widget that
is supposed to set the value for appsmith.store.ticket is working correctly
and it's being executed before your query runs. 3. If you copy and pasted the
code, there might be additional setup required that was not included in the
snippet you used. Double-check the blog post or tutorial you followed to ensure
that there are no missing steps. Since you're new to Appsmith and might not be
familiar with all its features yet, it's essential to go through tutorials or
documentation to understand how the store object works and how you can
leverage it in your apps. Can you provide me with the specific code snippet
you're using where the error occurs, or describe when and how you're expecting
appsmith.store.ticket to be set? This would help me guide you more accurately
to resolve the issue. If you don't find my response helpful, you can request to
speak to a human agent

chilly edge
#

How do I set up appsmith.store.ticket as a value in the app?

frail riverBOT
#

To set a value in appsmith.store, you typically use the storeValue function
in Appsmith. This is usually done within a JavaScript function or as part of a
workflow after an event like a button click or API call. Here's an example of
how you might set a value for appsmith.store.ticket: 1. Navigate to an event
in your app, such as a button click or onSuccess of an API call where you want
to set the value. 2. Add a JavaScript code snippet to set the value, such as:
javascript storeValue('ticket', 'your_value_here'); 3. Replace
'your_value_here' with the actual value you wish to store. 4. Now, you can use
appsmith.store.ticket in your queries or any other part of the app to access
the value you have set. If you need to set appsmith.store.ticket based on user
input, you can grab the value from a widget like an input field and store it
like this: javascript storeValue('ticket', Input1.text); In this case,
replace Input1.text with the appropriate property from the widget from which
you are collecting the value. If you have a specific place in your app where you
want to perform this action and aren't sure exactly how to integrate it, please
let me know the details, and I can give you a more tailored walkthrough. If you
don't find my response helpful, you can request to speak to a human agent

chilly edge
#

This is the content of the tutorial, where in the tutorial do I find the information to set the value?

frail riverBOT
#

The tutorial you've provided does not contain details on setting the
appsmith.store.ticket value. However, I found relevant information in the
Appsmith Documentation that describes how to set app-level data or temporary
state using the storeValue() method: The storeValue(key, value) method lets
you add or update data in the appsmith.store, which you can then access by
referencing their keys. So to set up appsmith.store.ticket, you would use a JS
function or event handler in your Appsmith app like this: javascript storeValue('ticket', value); Here, value would be the value you want to
store, for example, a response from an API, a user input, or any data that your
application needs to store globally. You access saved data using the key you
set, in your case, you would access the ticket data with appsmith.store.ticket
throughout your application wherever needed. If you need further assistance with
how and where to implement this in your application based on the tutorial's
context, please let me know, and I can provide more detailed
instructions.【1:1†Appsmith Documentation.md】 If you don't find my response
helpful, you can request to speak to a human agent

chilly edge
#

I've added storeValue('ticket', value); in "Editor" > pages> "JS" and it gives me this error

frail riverBOT
#

To properly set a value using storeValue, it needs to be part of a JavaScript
action or event handler and not placed directly in the Editor > Pages > JS
without any context. The error likely occurs because value is not defined or
because the script isn't executed in response to an event. Here's what you
should do: 1. Define the value you want to store. This could come from an input
field, API response, or any other source within your app. 2. Use the
storeValue function within an action, such as a button click handler or the
onSuccess event of a query or API call. For example, say you want to store a
user's input when they submit a form. Assuming your input widget is named
Input1 and your button is named SubmitButton, your code on the button's
onClick event will look like this: javascript // This action will be triggered when the SubmitButton is clicked storeValue('ticket', Input1.text); Make sure to replace Input1.text with the actual reference to the value
you want to store. The context of where and how you use storeValue is
important. Using it directly in the JavaScript section without an event or
function to trigger it won't work. If you're still encountering issues, please
share more details about where you want to set the value and the source of the
value, so I can provide further assistance. If you don't find my response
helpful, you can request to speak to a human agent