This tutorial explains how one can construct a BMI calculator app with Google Sheets and Google Types. When a consumer submits the shape, their BMI rating is calculated in Google Sheets and a customized report is generated in Google Docs. The consumer then receives an e mail with their BMI rating and the PDF report.
👋 Full this fast Google Form to calculate your BMI and obtain a customized report in your inbox.
BMI Calculator with Google Types
Now we have a Google Form that asks the consumer to enter their top and weight. The response is saved in a Google Sheet and the BMI rating is calculated mechanically utilizing the BMI system.
The PDF report is customized and contains the consumer’s BMI rating, BMI class, and options on tips on how to enhance their BMI rating. The consumer’s picture can be embedded within the report as proven within the screenshot above.
BMI Calculations in Google Sheets
We carry out the next calculations in Google Sheets to calculate the consumer’s BMI rating.
Age of the respondent
The shape requires the consumer to enter their date of delivery. We use the DATEDIF operate to calculate the age of the consumer in years.
=MAP(C:C, LAMBDA(c, IF(ROW(c)=1, "Age",
IF(ISDATE(c), ROUND(DATEDIF(c, TODAY(), "Y"), 0),))))
BMI Rating (kg/m²)
The consumer enters their top and weight within the type. We use the MAP operate to calculate the BMI rating for every type response within the sheet.
=MAP(E:E,F:F, LAMBDA(ht, wt, IF(ROW(wt)=1, "BMI",
IF(AND(ISNUMBER(wt),ISNUMBER(ht)),
ROUND(wt/(ht/100)^2,2),))))
BMI Class
The BMI class is calculated utilizing the array operate.
=ARRAYFORMULA(IF(ROW(J:J)=1, "BMI Class", IF(ISNUMBER(J:J),
IF(J:J < 18.5, "Underweight",
IF(J:J < 25, "Regular weight",
IF(J:J < 30, "Chubby", "Overweight"))),)))
Put together BMI Report
We’ve created a template in Google Docs that will probably be used to generate customized BMI reviews for every consumer with the assistance of Document Studio.
The report makes use of conditional content material to show options primarily based upon the BMI rating of the consumer. As an example, if the BMI rating is lower than 18.5, the consumer is underweight and the report means that they need to eat extra energy.
The picture is inserted within the report utilizing a particular Embed Image tag so as to add thethe picture uploaded by the consumer within the Google Kind within the doc.
Create BMI Workflow
Launch Doc Studio inside the shape responses sheet and go to Extensions > Doc Studio > Open to create a brand new BMI workflow.
We’ll solely course of the shape responses which have a legitimate e mail tackle, the age of the consumer is numeric, and the calculated BMI rating is at the least 10.
On the subsequent display screen, add a Create File
job and choose the Google Docs template that we’ve created within the earlier step. You may additionally wish to change the title of the generated PDF file to incorporate the title of the shape respondent.
Click on the Add One other Job
button so as to add the Ship Electronic mail
job. This can ship the generated PDF report back to the consumer through e mail.
For the recipient’s e mail tackle, choose the Electronic mail
column from the Google Sheet. You too can customise the e-mail topic and the physique of the e-mail.
The Connect Merged Recordsdata
choice needs to be enabled in order that the generated PDF report is connected to the e-mail. That’s it. Click on the Save Workflow
button and your BMI calculator is prepared to be used.
You’ll be able to view the tutorial part for extra concepts on Google Forms automation with Doc Studio.