Hi,
I want to send some info back from the server to the data table at certain points. How would I do this?
MANY thanks in advance!
Michael
Hi,
I want to send some info back from the server to the data table at certain points. How would I do this?
MANY thanks in advance!
Michael
Could you show what you have tried with code examples?
When you say “at certain points”, are you referring to background tasks that occur at some time interval?
Also, just to clarify, when you say that you want to return data from the server and then to a data table, are you referring to Anvil’s DataTables, or are you referring to a client-side DataGrid? I’m just asking so that the information can be clarified.
In general, when you ask a question on the forum you will want to make sure that you show prior research and effort on your part (with code examples preferably, and possibly mentioning similar Anvil tutorials that have not fully answered your question). If you follow these guidelines in some small way, that usually goes a long way in terms of folks just being able to jump in and help quickly.
So, all that said, with the current information given, you could search the docs for background and/or scheduled tasks, DataTables, and possibly DataGrids (though that may not be of interest).
Hi. This is a more thorough explanation…
Thank you for clarifying.
If I understand correctly, you are asking how to take data from your local computer, and pass it to an Anvil app.
For this you will want to look into Anvil’s wonderful Uplink functionality. It creates a two-way connection between your app and your local computer (or any computer with an internet connection). This means you can pass data back and fourth as needed.
You can enable the Uplink by clicking the icon in the Anvil IDE, clicking “Uplink” and then following the instructions.
Here is an example from the docs where an app calls a function on a local computer and returns data. That is, the app receives data that originated on the local machine.
import anvil.server
anvil.server.connect("<your Uplink key>")
@anvil.server.callable
def get_data(name):
print(f"Hello from your own machine, {name}!")
return [1, 2, 4, 8]
anvil.server.wait_forever()
# the app can now call this function and return its data
# the app can simply treat it as a standard server function
If I have misunderstood the question, please let me know. Good luck with your development.