Hello,
I’m new to Blaze, and I have to admit that I’m having a bit of trouble understanding everything in the documentation. I'm French and using a translator, so some sentences might be poorly translated.
Here’s my project: I have a website with client records and many documents to fill in with this information. I want to automate this process. For example, when I’m on a PDF and type "/name", the client's name should be automatically inserted.
I found that the "{site: text}" function allows me to retrieve information from the website (name, first name, etc.), but I can only use it within my browser. So, I thought of creating a database with a table containing fields like name, first name, date of birth, etc. The idea would be to have a command like "/import" that imports all the data into Blaze, allowing me to use them in my PDF with "/name".
However, I’m facing an issue: I can’t modify the data. For example, I want to update the following line:
{dbupdate: UPDATE \
Export Arianne` WHERE rowid() = "1"; space=5SiCS7KAXicGBMj21y6rge; autoaddfields=yes}`
But I can’t manage to insert the value retrieved from the website into the "name" field.
Do you have a solution to help me resolve this issue?
Thanks in advance!
Welcome to the community @Robin_Tuffet!
There are 2 issue with dbcommand
:
Make sure that app for PDF lets you paste text (so that you can copy and paste text works there). Otherwise Text Blaze won't work there. If you have data that needs to be pasted into pdf with site
command, then you might skip Data Blaze and paste it directly to pdf. If you want to save that data for later use, then Data Blaze would be perfect for that.
-
rowid - is a 22 character long identifier that can be obtained by expanding row details and getting last part of URL.
-
You should specify fields to update in an update command, like in the example below. You can find more information and examples in the documentation
Here is an example:
{dbupdate: UPDATE `Export Arianne` SET name="test" WHERE rowid() = "ROW_ID_HERE"; space=SPACE_ID_HERE; autoaddfields=yes}
Hello and thank you very much for your feedback. Regarding the PDF, I can insert names, I already do it with simple names. As for the documentation, I’ve looked into it, but I’m having trouble understanding everything since I'm not familiar with the code. However, I tried your command, and it seems to be correctly acknowledged, but no changes are being made to the data. If I'm not mistaken, this should replace the value in the "name" column and row 1 (the one where I took the ID), but nothing changes.
{dbupdate: UPDATE Export Arianne
SET name="test" WHERE rowid = "348mG9MXzPV4Lpb4IU4GfM"; space=:5SiCS7KAXicGBMj21y6rge; autoaddfields=yes}
There was a typo in my previous reply in dbupdate
command + there are some issue in the dbupdate command you shared - rowid is a function and needs to be called with parentheses. Here is an updated command to try:
{dbupdate: UPDATE `Export Arianne` SET name="test" WHERE rowid() = "348mG9MXzPV4Lpb4IU4GfM"; space=5SiCS7KAXicGBMj21y6rge; autoaddfields=yes}
1 Like
Thank you very much, it works perfectly!
I would like to ask you one last question: to read from another blaze, I did this:
{dbselect: SELECT NomUsage FROM \
Export Arianne` WHERE rowid() = "348mG9MXzPV4Lpb4IU4GfM"; space=5SiCS7KAXicGBMj21y6rge; menu=yes}`
It works, but it asks me to select the value. Is it possible for it to write the value directly without asking me, since I have specified the column and the row, and there can only be one value?
Sure, that is possible.
dbselect
command has menu
setting which is enabled in your example. Once you disable that setting, you'll get the resulting value in a variable. Use that variable to display or for further processing. Example:
{dbselect: SELECT NomUsage FROM `Export Arianne` WHERE rowid() = "348mG9MXzPV4Lpb4IU4GfM"; space=5SiCS7KAXicGBMj21y6rge; menu=no}
={NomUsage}
Okay, I see, thank you. But am I required to go through the dialog box and click "Insert"?
Yes, there is currently no way to avoid form window pop up.
1 Like