Replies: 3 comments 2 replies
-
after further investigation it might be related to data format. I saw id value displayed like this in the input tab of a failing test details I did earlier: He somehow managed to convert it to integer and removed the foreign characters and only keep the real value, but I am not able to recreate his success in my own automation rule. I tried to adapt his value to my needs like this the output is still a failure This seems like an overly complicated workaround for a strange issue. How come the .id value which is an Integer type in the database becomes another type in the first place and is now with other random chars? |
Beta Was this translation helpful? Give feedback.
-
Hi @Reftek85 I've been looking into this for you. It seems like the ID you're getting back from your source is being Percent Encoded or URI encoded (Uniform Resource Identifier). The You can use the built in JavaScript function decodeURI() to unpick this and turn it back into something a little more useful, and then access the first value of the array by indexing it This only treats the symptom though, and not the root cause. Why your identifier is being URI encoded might be worth looking into within your MYSQL database. I hope this helps get you unstuck. |
Beta Was this translation helpful? Give feedback.
-
Hi, the page that open is /client-form/1 I tried JSscript as step one to decode and use that value to the next step but the client.id still has no value when automation creates the row.
It seems like the id column seems to be unusable. I created a new task but if i try a test valu like {{ trigger.row.firstname }} to a text colum the value is passed, if I use my ID column which is my primarykey, there is no valu passed to the other step. |
Beta Was this translation helpful? Give feedback.
-
I will try to keep it simple,backend is a MYSQL database,
example BD
table1: clients
column: id INT(11) (autoincrement) primarykey
table2: file
column: id INT(11) (autoincrement) primarykey
column: client_id INT(11)
I am trying to do this:
trigger: row created
table: clients
create row
table: file1
client_id: clients.id
Row ID *: {{ trigger.id }}
I tried a lot of things but I only get three result, the row gets created with an empty field at destination, error invalid inputs, or [object Object] red popup error
I tried to pass the value a lot of way after looking online but I dont understand much of what I find
I tried things like this
{{ steps.1.rows.0.id }}
{{ trigger.row.id }}
also, I would like those new row in the other table to have the budibase relationship working in case I want to use it that way.
I created a relationship in Budibase clients(ID)> one to many file > file1(client_id)
will I need to create an update column manually in the same automation with another builtin like ._id or will the relationship be created automaticcaly while the previous automation does its thing?
i was thinking this logic: update row on table file1 WHERE client_id = {{ trigger.id }}
the budibase relationship column in file1 is name "clients"
so update value of column clients with "{{ steps.1.rows.0._id }}
I tried this as well but values are still empty in the created rows....
Please help I am lost here and can't find any real complete information on how automation works.
Thank you to anyone that can help!
Reftek85
Beta Was this translation helpful? Give feedback.
All reactions