var request =HttpUtil.get("https://randomuser.me/api");var jsonContent =JsonUtil.parse(request.asString().getBody());var user =jsonContent.get("results").get(0);// Create a table to store the datavar table =SuiteTable.create("UsersTable");table.addStringColumn("uuid");table.addStringColumn("firstname");table.addStringColumn("lastname");table.addStringColumn("gender");table.addStringColumn("country");table.addStringColumn("city");table.addStringColumn("email");table.addStringColumn("phone");// Populate the table with data from the APIvar uuid =user.get("login").get("uuid").asText();var firstname =user.get("name").get("first").asText();var lastname =user.get("name").get("last").asText();var gender =user.get("gender").asText();var country =user.get("location").get("country").asText();var city =user.get("location").get("city").asText();var email =user.get("email").asText();var phone =user.get("phone").asText();var row = {"uuid": uuid,"firstname": firstname,"lastname": lastname,"gender": gender,"country": country,"city": city,"email": email,"phone": phone};table.addRow(row);// Return the tablereturn table;
DataPrep
Weather
var table =NodeInputReader.inputAsDataFrame();var city =table.row(0).getString("city");var request =HttpUtil.get("https://wttr.in/"+ city +"?format=2");var body =request.asString().getBody().trim();
Send Email (Global SMTP)
Email (property)
var table =NodeInputReader.inputAsDataFrame();returntable.row(0).getString("email");
City (property)
var table =NodeInputReader.inputAsDataFrame();returntable.row(0).getString("city");
var table =NodeInputReader.inputAsDataFrame();returntable.row(0).getString("weather");
General configuration
To:
${EMAIL}
Subject:
Welcome to "Company", ${FULL_NAME}!
Message:
Dear ${FULL_NAME},
Welcome to the "Company" family! We’re thrilled to have you join our team.
As you settle in, we hope the weather (${WEATHER}) in ${CITY} reflects the warmth and excitement we feel about having you onboard.
We believe that your skills and experiences will make a positive impact on our journey together. If you have any questions or need support as you get started, please don’t hesitate to reach out—we’re here to help.
Looking forward to meeting you in person and working together!