Dear all,
I have a mysql table like:
CREATE TABLE IF NOT EXISTS `mytable` (
`aid` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL
PRIMARY KEY (`aid`)
)
I would like to select the "aid" and send an email like:
"Dear customer, your aid value is ...."
To do this, I'm using a "Read Data" (labelled read_data12)

using the email in where condition

and having the following "Data Setting":

My question is:
How to get the aid value and put it into the body of an email?
I'm trying using {var:aid} but it returns an empty string.
If I use {var:read_data12} in email body, I obtain
How to get the aid 24 instead of the above structure?
Regards
I have a mysql table like:
CREATE TABLE IF NOT EXISTS `mytable` (
`aid` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL
PRIMARY KEY (`aid`)
)
I would like to select the "aid" and send an email like:
"Dear customer, your aid value is ...."
To do this, I'm using a "Read Data" (labelled read_data12)

using the email in where condition

and having the following "Data Setting":

My question is:
How to get the aid value and put it into the body of an email?
I'm trying using {var:aid} but it returns an empty string.
If I use {var:read_data12} in email body, I obtain
{"myemailaddress@gmail.com":"24"}
How to get the aid 24 instead of the above structure?
Regards
Hi touretteroma ,
I think that you just need the Read data action to return a single record, not an array of key/value pairs - that is used to populate drop-down elements.
Bob
I think that you just need the Read data action to return a single record, not an array of key/value pairs - that is used to populate drop-down elements.
Bob
Dear Bob,
I changed the "Select type" to "First matching record" in my "Data Read" object in "3 Setup - select form functions" section.
But how I can get the retrieved field "aid"?
- Using {var:aid} returns an empty string
- Using {var:read_data12} returns
and I didn't understood how to get the aid value 27
Regards
I changed the "Select type" to "First matching record" in my "Data Read" object in "3 Setup - select form functions" section.
But how I can get the retrieved field "aid"?
- Using {var:aid} returns an empty string
- Using {var:read_data12} returns
{"DataRead":{"email":"myemailaddress@gmail.com","aid":"27"}}
and I didn't understood how to get the aid value 27
Regards
{var:read_data12.aid}
This topic is locked and no more replies can be posted.