Skip to main content

Automatically calculate age based on ID number

1. Create a form

Create a common form, add a single line of text to enter the ID number, and a numeric component to obtain information, as shown in the following figure:

Form editing page

2. How to obtain age based on ID card

Determine whether the ID card information is 18 bits before calculating. Obtain the information of the birth year in the ID number and the year of the current time for calculation, and obtain the age. Because the result data type of the LEFT(), RIGHT(), TEXT() functions is a string, to calculate, you need to convert VALUE() to a VALUE.

Description: The 7-10th ID card is the information of the year of birth.

The following code can be directly copied to the formula editor,Note that the ID card field is replaced..

{"text":"IF(EQ(LEN(​身份证​),18),VALUE(TEXT(TODAY(),\"yyyy\"))-VALUE(RIGHT(LEFT(​身份证​,10),4)),\"\")","marks":[{"from":{"line":0,"ch":10,"sticky":null},"to":{"line":0,"ch":15,"sticky":null},"value":"textField_kn8841dw","invalid":false},{"from":{"line":0,"ch":66,"sticky":null},"to":{"line":0,"ch":71,"sticky":null},"value":"textField_kn8841dw","invalid":false}],"isCmData":true}

3. Video case

此处为语雀视频卡片,点击链接查看:沈强-5.21-获取身份证信息.mp4


YIDA in order to better optimize the content and quality of YIDA user manual, it takes you 3-5 minutes to fill in the document feedback questionnaire. The document feedback questionnaire is submitted anonymously, and the questionnaire information is only used for YIDA document experience feedback collection. Thank you for your support for YIDA!

Click here to fill in the questionnaire

-------------------- Get the latest information YIDA, welcome to follow US--------------------

This doc is generated using machine translation. Any discrepancies or differences created in the translation are not binding and have no legal effect for compliance or enforcement purposes.
Copyright © 2024钉钉(中国)信息技术有限公司和/或其关联公司浙ICP备18037475号-4