open-xml-templating / docxtemplater

Generate docx, pptx, and xlsx from templates (Word, Powerpoint and Excel documents), from Node.js or the browser. Demo: https://www.docxtemplater.com/demo. #docx #office #generator #templating #report #json #generate #generation #template #create #pptx #docx #xlsx #react #vuejs #angularjs #browser #typescript #image #html #table #chart
https://www.docxtemplater.com
Other
3.07k stars 350 forks source link

setting variable from object #757

Closed pulatnazarov closed 3 months ago

pulatnazarov commented 3 months ago

Greetings, i have this kind of object: { user: { "first_name": "Person", "last_name": "Person" } }

i want to set the user.first_name or user.last_name so how can i make it, thank you in advance?

edi9999 commented 3 months ago

Can you please add a bit more context ?

Do you want to achieve this from your template or from Javascript itself ?

You can install the angular parser : https://docxtemplater.com/docs/angular-parse/#angular-parser

With it, you can also assign values : https://docxtemplater.com/docs/angular-parse/#assignments