Reads a CV PDF and writes what it says onto a fresh copy of your own Google Docs CV template.
Uses
Google Docs
Google Drive
OpenAI
Put a CV onto your own template
cvFileLink to blank.Set cvFileLink to blank.cvTemplateDocumentLink to blank.Set cvTemplateDocumentLink to blank.cvFileLink and save it as cvFile.Trim cvFileLink and save it as cvFile.cvTemplateDocumentLink and save it as templateLink.Trim cvTemplateDocumentLink and save it as templateLink.cvFile starts with http (ignoring case) or cvFile starts with doc_…If cvFile starts with http (ignoring case) or cvFile starts with doc_…Yes
No
No steps
cvFile contains docs.google.com (ignoring case) or cvFile contains…If cvFile contains docs.google.com (ignoring case) or cvFile contains…Yes
No
No steps
templateLink doesn't contain /d/If templateLink doesn't contain /d/Yes
No
No steps
cvFieldNames to [full name, contact details, personal profile, skills, work experience, education, certifications, languages].Set cvFieldNames to [full name, contact details, personal profile, skills, work experience, education, certifications, languages].extractedFields to an empty list.Set extractedFields to an empty list.readErrorIf a step below fails, save the error as readErrorTry
cvFieldNa… and save it as extraction.Run an AI agent: Read the attached document and pull out each of these fields, in this order: - cvFieldNa… and save it as extraction.extraction.output.fields is emptyIf extraction.output.fields is emptyYes
No
No steps
extractedFields to extraction.output.fields.Change extractedFields to extraction.output.fields.On error
readError.message.Stop and report a problem: Could not read that CV, so no copy of your template has been made. The reason given was: readError.message.candidateName to blank.Set candidateName to blank.namedField in extractedFields:For each namedField in extractedFields:namedFieldName to blank.Set namedFieldName to blank.nameFieldErrorIf a step below fails, save the error as nameFieldErrorTry
namedField.name lowercase and save it as namedFieldName.Make namedField.name lowercase and save it as namedFieldName.On error
namedFieldName to blank.Change namedFieldName to blank.namedFieldName is full nameIf namedFieldName is full nameYes
nameValueErrorIf a step below fails, save the error as nameValueErrorTry
namedField.value and save it as candidateName.Trim namedField.value and save it as candidateName.On error
namedField.value with a space and save it as candidateName.Join namedField.value with a space and save it as candidateName.No
No steps
candidateName is emptyIf candidateName is emptyYes
candidateName to Unnamed candidate.Change candidateName to Unnamed candidate.No
No steps
newCvLink to blank.Set newCvLink to blank.copyErrorIf a step below fails, save the error as copyErrorTry
templateLink. Save it as copy.Duplicate templateLink. Save it as copy.copy.duplicate_link and save it as newCvLink.Trim copy.duplicate_link and save it as newCvLink.On error
copyError.message.Stop and report a problem: Could not copy your template, so nothing has been written. Your own template has not been touched. The reason given was: copyError.message.newCvLink doesn't contain /d/If newCvLink doesn't contain /d/Yes
No
No steps
newCvLink split by /d/ split by / and save it as newCvId.Get the first item of the last item of newCvLink split by /d/ split by / and save it as newCvId.sectionsWithNoPlace to an empty list.Set sectionsWithNoPlace to an empty list.sectionsNotInCv to an empty list.Set sectionsNotInCv to an empty list.wantedField in cvFieldNames:For each wantedField in cvFieldNames:placeholder to {{wantedField with replaced by _}}.Set placeholder to {{wantedField with replaced by _}}.fieldValue to blank.Set fieldValue to blank.extractedField in extractedFields:For each extractedField in extractedFields:extractedName to blank.Set extractedName to blank.extractedNameErrorIf a step below fails, save the error as extractedNameErrorTry
extractedField.name lowercase and save it as extractedName.Make extractedField.name lowercase and save it as extractedName.On error
extractedName to blank.Change extractedName to blank.extractedName is wantedFieldIf extractedName is wantedFieldYes
extractedValueErrorIf a step below fails, save the error as extractedValueErrorTry
extractedField.value and save it as fieldValue.Trim extractedField.value and save it as fieldValue.On error
extractedField.value with a new line and save it as fieldValue.Join extractedField.value with a new line and save it as fieldValue.No
No steps
valueToWrite to fieldValue.Set valueToWrite to fieldValue.fieldValue is emptyIf fieldValue is emptyYes
valueToWrite to Not stated in the CV.Change valueToWrite to Not stated in the CV.wantedField to the end of sectionsNotInCv and save it as sectionsNotInCv.Add wantedField to the end of sectionsNotInCv and save it as sectionsNotInCv.No
No steps
landed to false.Set landed to false.replaceErrorIf a step below fails, save the error as replaceErrorTry
placeholder with valueToWrite in newCvId. Save it as replaceResult.Replace placeholder with valueToWrite in newCvId. Save it as replaceResult.occurrences to replaceResult.occurrences_changed multiplied by 1.Set occurrences to replaceResult.occurrences_changed multiplied by 1.occurrences is greater than or equal to 1 and occurrences is less than or…If occurrences is greater than or equal to 1 and occurrences is less than or…Yes
landed to true.Change landed to true.No
No steps
On error
landed to false.Change landed to false.landed is no and fieldValue isn't emptyIf landed is no and fieldValue isn't emptyYes
wantedField - add placeholder to your templateAdd wantedField - add placeholder to your template
fieldValue to the end of sectionsWithNoPlace and save it as sectionsWithNoPlace.No
No steps
sectionsWithNoPlace and save it as noPlaceCount.Count the items in sectionsWithNoPlace and save it as noPlaceCount.noPlaceCount is greater than 0If noPlaceCount is greater than 0Yes
newCvId.Add text to newCvId.FROM THE CV BUT NOT PLACED
Your template has no placeholder for the sections below, so they are written out here rather than dropped. Add the placeholder named beside each heading to your template and run it again to have them filled in place.
sectionsWithNoPlace joined by a b...No
No steps
candidateName onto a copy of your template: newCvLinkShow in the output: Wrote the CV of candidateName onto a copy of your template: newCvLink
Sections your template had no placeholder for, written out at the end instead: noPlaceCount
Sections the CV does not contain, marked as not stated: sectionsNotInCv joined by , .