How to use "Fields to retrieve"?

touretteroma 22 Apr, 2018
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)

How to use

using the email in where condition

How to use

and having the following "Data Setting":

How to use

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
GreyHead 23 Apr, 2018
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
touretteroma 23 Apr, 2018
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

{"DataRead":{"email":"myemailaddress@gmail.com","aid":"27"}}


and I didn't understood how to get the aid value 27
Regards
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger