Copiar link para a área de transferência
Copiado
Hi,
Im trying to generate a document in word using the Adobe Document Generation plugin, using the json data as below. When I click on generated document I get the error as in screenshot below. I Validated the json and didn't find any issues.
Any ideas
[
{
"OwnerID": "L001",
"Properties": [
{
"PropertyID": "P001",
"Property Address": "12 St LA",
"Rent": "300",
"Bedroom": "2"
},
{
"PropertyID": "P002",
"Property Address": "3 St SA",
"Rent": "450",
"Bedroom": "3"
}
]
},
{
"OwnerID": "L002",
"Properties": [
{
"PropertyID": "P003",
"Property Address": "4 St SA",
"Rent": "500",
"Bedroom": "4"
}
]
},
{
"OwnerID": "L003",
"Properties": [
{
"PropertyID": "P004",
"Property Address": "20 St LA",
"Rent": "400",
"Bedroom": "2"
}
]
}
]
Copiar link para a área de transferência
Copiado
Are you still getting this error now? Can you share the Word doc?
Copiar link para a área de transferência
Copiado
Hi,
its a standard word file and please find below the steps on the document generation using the json. As shared, if I use the first object in the json, there is no error but when the complete json is used, the server error appear. Wondering if there is any issue in the json schema
Thanks
Copiar link para a área de transferência
Copiado
So, the error you are getting is weird (btw, this is the same person who responded earlier, I accdentially responded on my personal account), however, the JSON you are sending will not work. You are sending an array of values. In your table, when you say Properties.PropertyID, it expects an array named Properties. You do not have that. You have an array as the top level object with a Properties key under it.
For this to work, you would need a top level value named Properties, that is an array of objects having keys, PropertyID and Rent.
Now, if the data you shared is your original data, don't forget you can adjust your data before calling the API. In this case, I'd have code that makes a new array based on iterating the existing array.
Copiar link para a área de transferência
Copiado
As an aside, I can confirm now that our API does *not* support Arrays as a top level object, only, well, objects (key value pairs), you can obviously have arrays underneath that. Our Word Add-In is just checking for valid JSON.
So we need to edit the docs, _and_ the Word Add-In.
To be clear, you can't just take your *existing* array and put it in an object, you need to make Properties itself an array.
Copiar link para a área de transferência
Copiado
Hi Raymond
Below is the data source in excel and I'm using power automate to generate the json. I would greatly appreciate if you could provide a the json schema for the table below. Please note the properties are associated with an Owner i.e OwnerID. An Owner can have more than 1 property
Excel Data:
OwnerID | PropertyID | Property Address | Rent | Bedroom |
L001 | P001 | 12 St LA | 300 | 2 |
L001 | P002 | 3 St SA | 450 | 3 |
L002 | P003 | 4 St SA | 500 | 4 |
L003 | P004 | 20 St LA | 400 | 2 |
Thanks
Jag
Copiar link para a área de transferência
Copiado
I'm not quite sure what you mean here. When you get the data from Excel, it is an array? If so, then you need to change the data before sending it.
Copiar link para a área de transferência
Copiado
Hi Raymond,
I came across the bleow medium article on the same and the json schema looks similar to the above
https://blog.developer.adobe.com/hands-on-with-adobe-document-generation-api-d2176f59026c
Thanks
Jag
Copiar link para a área de transferência
Copiado
I wote that article, and I'm pretty sure there are no top level arrays. 🙂 Can you tell me if you see me passing data where the _top_ level value itself is an array?
Copiar link para a área de transferência
Copiado
The data source is an excel file as above. As shared, I'm using power automate to convert the excel file to json to bulk generate documents using Adobe Document Generator API.
Here is the link to power automate forum on how the excel table is converted to json:
Could you please share what changes need to be made in the json. Probably a sample template will help please.
Thank you.
Copiar link para a área de transferência
Copiado
Unfortunately I don't have a PA example handy that shows how to do this, and the best I can suggest is what I would do - googling for how to reshape data in PA. I firmly believe it's possible. I'd like to help and I'm curious myself how to do this, but I can't promise to have a solution anytime soon.
Copiar link para a área de transferência
Copiado
So I'm having the exact error as generated here, but I'm getting it on a much simpler level. Here's the steps I took to get this far:
Generated my JSON file from an Excel table
Ran the generated .json file through a validation engine I found online
Fixed any invalid JSON by adjustment of the formulas that generate the column data
Installed the Word add-in
Imported the corrected .json file (it allowed me to generate the tags, so up until this point, I think the JSON is good)
Picked a handful of tags to test the generation and insterted them into a blank Word file with only a carriage return between them
clicked on the "Generate Document" button contained in the Word Add-in
Up pops the error as described by the original poster....
Thoughts: Although I read through the documentation regarding REST API's and the rest, I didn't think any of that applied to my situation as I just simply want to do this natively within the Word App itself, and am assuming that is supported by the Add-in. As long as the JSON file and the corresponding template reaches the servers at Adobe, it should process it and send it back to my desktop app, right?
The .json I'm using is BIG!! (51270 lines). This is completely on purpose as the data set I'm handling may absolutely be this large in a real-world scenario. I fully expect the resulting Word or PDF document to be well over 1500 pages in length. Does this pose an issue with the generation? Do I need to chunck this out into smaller runs?
If my assumption above is false, and I need to generate some code to insert into a web application somewhere, then this isn't the solution I'm looking for. Please tell me if I'm barking up the wrong tree here.
Copiar link para a área de transferência
Copiado
So the Word Add In is never going to give really good error reporting as it's more for casual testin and the like. There are _absolutely_ limits for Doc Gen and all the services. You can see them here: https://developer.adobe.com/document-services/docs/overview/limits/
Specifically for DocGen, the limit for the JSON is 10 megs, and I bet that's your issue. Also, 1500 pages may break the 100 meg file limit size as well.
Copiar link para a área de transferência
Copiado
I have been facing the same issue for the last Week. What is the solution for this?
Copiar link para a área de transferência
Copiado
I'm also facing this issue and have spent many hours attempting to troubleshoot. Is there any solution?
Copiar link para a área de transferência
Copiado
Hi Group!
I am also getting the same error as of Monday this week. My last Word auto-update was Nov 11 and issue started Nov 25. MacOS. The Word plug-in produce the same error as in the screenshot in the original post. When I run the process through the API in the Document Generation module of the application our company develops and supports for our customers I get the attached error saying the document is corrupt. I have tried multiple different templates with different complexity levels, and even a completely blank document, and one with a single merge field. All same result. There are no Word updates pending at the moment, I will try and reinstall the plug-in but I suspect it's not going to work as the error is also thrown by the API generation call from the embedded app. Any ideas on what to troubleshoot next?
Copiar link para a área de transferência
Copiado
If you get the error in the Word Add-In and via the API, it may be a network block on your side perhaps? I just tested and the API is working fine for me.
Copiar link para a área de transferência
Copiado
Copiar link para a área de transferência
Copiado
Nevermind, a result showing corrupted doc would NOT be a network issue. I'd say let's focus on the API side, not the Word Add-In for now. Are you able to send me a copy of one Word doc showing the issue?
Copiar link para a área de transferência
Copiado
Hi Raymond. Certainly. Let me collect the JSON and a couple of the templates.
{"stackng__STACKID__c":"312D76","stackng__FinishAirport__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeaVAAT"},"Id":"a015f00000DAeaVAAT","Name":"KPDK/PDK - DeKalb–Peachtree"},"stackng__RouteAirportCodes__c":"KPDK-KATL-KVNY-KPDK","stackng__Aircraft__c":"a005f000008qgpHAAQ","stackng__SalesOwner__c":"0055f000006W4y5AAC","stackng__Model__r":{"attributes":{"type":"stackng__Model__c","url":"/services/data/v62.0/sobjects/stackng__Model__c/a0C5f000018n30LEAQ"},"stackng__BaggageCapacity__c":"","Id":"a0C5f000018n30LEAQ","Name":"Challenger 650"},"stackng__ImageExterior__c":"https://stackimagesdatastore.blob.core.windows.net/bosimages/placeholder-exterior-590x360.png","stackng__FlightMapImageHtmlTag__c":"","Name":"22020173 Demo Customer VIP, Inc. (Multi Leg)","stackng__StartAirport__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeaVAAT"},"Id":"a015f00000DAeaVAAT","Name":"KPDK/PDK - DeKalb–Peachtree"},"stackng__PAXest__c":3,"stackng__FinishAirport__c":"a015f00000DAeaVAAT","stackng__TripNumber__c":"22020173","stackng__Account__r":{"attributes":{"type":"Account","url":"/services/data/v62.0/sobjects/Account/0015f00000CSOF4AAP"},"Id":"0015f00000CSOF4AAP","Name":"Demo Customer VIP, Inc."},"stackng__NotesToClient__c":"","stackng__Operator__c":"0015f00000LaAteAAF","stackng__Aircraft__r":{"attributes":{"type":"stackng__Aircraft__c","url":"/services/data/v62.0/sobjects/stackng__Aircraft__c/a005f000008qgpHAAQ"},"stackng__Seats_formula__c":16,"stackng__SeatConfig__c":"","stackng__TailNumber__c":"OH-WIW","Id":"a005f000008qgpHAAQ","Name":"OH-WIW Challenger 650 (EFHK/HEL)"},"stackng__StartAirport__c":"a015f00000DAeaVAAT","stackng__ImageInterior__c":"https://stackimagesdatastore.blob.core.windows.net/bosimages/placeholder-interior-590x360.png","stackng__Contact__r":"","stackng__Account__c":"0015f00000CSOF4AAP","stackng__TripDatesLocal_text__c":"15-Nov-2024 to 17-Nov-2024","stackng__Operator__r":{"attributes":{"type":"Account","url":"/services/data/v62.0/sobjects/Account/0015f00000LaAteAAF"},"Id":"0015f00000LaAteAAF","Name":"Jetflite OY"},"stackng__ImageLayout__c":"https://stackimagesdatastore.blob.core.windows.net/bosimages/placeholder-layout-590x220.png","stackng__Contact__c":"","stackng__TripName_formula__c":"22020173 Demo Customer VIP, Inc. (Multi Leg)","stackng__SalesOwner__r":{"attributes":{"type":"User","url":"/services/data/v62.0/sobjects/User/0055f000006W4y5AAC"},"Id":"0055f000006W4y5AAC","Name":"Johan Demo"},"Id":"a0J5f000000j97hEAA","stackng__Model__c":"a0C5f000018n30LEAQ","stackng__StartDateLocal__c":"2024-11-15","UserName":"Johan Demo","UserEmail":"johan+devops@stack.aero","UserTitle":"Senior Charter Sales Executive","UserPhone":"+1 404 490-1197","UserMobile":"+1 404 935 8702","CurrentDate":"26-Nov-2024","CurrentDateTime":"26-Nov-2024 11:57:46 -0500","SignTags":"{{#clientDate=Date1_es_:signer1:date:format(date,'mmm dd, yyyy HH:mm')}} {{#clientSign=Signature1_es_:signer1:signature:dimension(width=50mm, height=9mm)}} {{#clientName=Name1_es_:signer1:fullname}} {{#clientTitle=Ttl1_es_:signer1:title}} {{#clientCompany=Cmpy1_es_:signer1:company}} {{#clientInitials=Int1_es_:signer1:initials}} {{#clientAddress=Address1_es_:signer1:multiline(3):dimension(width=50mm)}} {{#senderDate=Date2_es_:signer2:date:format(date,'mmm dd, yyyy HH:mm')}} {{#senderSign=Signature2_es_:signer2:signature:dimension(width=50mm, height=9mm)}} {{#senderName=Name2_es_:signer2:fullname}} {{#senderTitle=Ttl2_es_:signer2:title}} {{#senderCompany=Cmpy2_es_:signer2:company}} {{#senderInitials=Int2_es_:signer2:initials}} {{#senderAddress=Address2_es_:signer2:multiline(3):dimension(width=50mm)}}","stackng__Segments__r":[{"stackng__From__c":"a015f00000DAeaVAAT","stackng__ToIATA__c":"ATL","stackng__To__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeYVAA1"},"stackng__LocalName__c":"Hartsfield–Jackson Atlanta International Airport","stackng__ShortName_formula__c":"KATL/ATL (Atlanta, GA)","Id":"a015f00000DAeYVAA1","Name":"KATL/ATL - Hartsfield–Jackson Atlanta International"},"stackng__ToCity__c":"Atlanta, GA","stackng__ArriveDay__c":"Fri","stackng__ArriveTimeLocal12H__c":"9:36am","stackng__CrewNotes__c":"","stackng__PaxCount__c":1,"stackng__renderBaggageDetails__c":false,"stackng__Model__r":{"attributes":{"type":"stackng__Model__c","url":"/services/data/v62.0/sobjects/stackng__Model__c/a0C5f000018n30LEAQ"},"stackng__BaggageCapacity__c":"","Id":"a0C5f000018n30LEAQ"},"stackng__OperatorName__c":"Jetflite OY","Name":"Leg 1","stackng__FromCodes__c":"KPDK/PDK","stackng__To__c":"a015f00000DAeYVAA1","stackng__FromIATA__c":"PDK","stackng__DepartTimeLocal__c":"09:00","stackng__EBT_formula__c":"0h 36m","stackng__LegNumber__c":1,"stackng__ArriveDateLocal_text__c":"15-Nov-2024","stackng__DepartTimeLocal12H__c":"9:00am","stackng__FlightNumber__c":"","stackng__renderPaxNotes__c":false,"stackng__ToCodes__c":"KATL/ATL","stackng__PassengerNotes__c":"","stackng__BaggageDetails__c":"","stackng__DepartDateLocal_text__c":"15-Nov-2024","stackng__DepartDay__c":"Fri","stackng__DepartureFBO__r":"","stackng__Model_formula__c":"Challenger 650","stackng__FromCity__c":"Atlanta, GA","stackng__renderCrewNotes__c":false,"stackng__PaxActual__c":0,"Id":"a0F5f000001WqTuEAK","stackng__Aircraft_formula__c":"OH-WIW","stackng__Model__c":"a0C5f000018n30LEAQ","stackng__From__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeaVAAT"},"stackng__LocalName__c":"DeKalb–Peachtree Airport","stackng__ShortName_formula__c":"KPDK/PDK (Atlanta, GA)","Id":"a015f00000DAeaVAAT","Name":"KPDK/PDK - DeKalb–Peachtree"},"stackng__ArrivalFBO__r":"","stackng__ArriveTimeLocal__c":"09:36","stackng__DepartTimeTBC__c":false,"index":1,"stackng__Pax__r":[],"stackng__SegmentServices__r":[]},{"stackng__From__c":"a015f00000DAeYVAA1","stackng__ToIATA__c":"VNY","stackng__To__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeTJAA1"},"stackng__LocalName__c":"Van Nuys Airport","stackng__ShortName_formula__c":"KVNY/VNY (Van Nuys, CA)","Id":"a015f00000DAeTJAA1","Name":"KVNY/VNY - Van Nuys"},"stackng__ToCity__c":"Van Nuys, CA","stackng__ArriveDay__c":"Fri","stackng__ArriveTimeLocal12H__c":"12:05pm","stackng__CrewNotes__c":"","stackng__PaxCount__c":3,"stackng__renderBaggageDetails__c":false,"stackng__Model__r":{"attributes":{"type":"stackng__Model__c","url":"/services/data/v62.0/sobjects/stackng__Model__c/a0C5f000018n30LEAQ"},"stackng__BaggageCapacity__c":"","Id":"a0C5f000018n30LEAQ"},"stackng__OperatorName__c":"Jetflite OY","Name":"Leg 2","stackng__FromCodes__c":"KATL/ATL","stackng__To__c":"a015f00000DAeTJAA1","stackng__FromIATA__c":"ATL","stackng__DepartTimeLocal__c":"11:00","stackng__EBT_formula__c":"4h 05m","stackng__LegNumber__c":2,"stackng__ArriveDateLocal_text__c":"15-Nov-2024","stackng__DepartTimeLocal12H__c":"11:00am","stackng__FlightNumber__c":"","stackng__renderPaxNotes__c":false,"stackng__ToCodes__c":"KVNY/VNY","stackng__PassengerNotes__c":"","stackng__BaggageDetails__c":"","stackng__DepartDateLocal_text__c":"15-Nov-2024","stackng__DepartDay__c":"Fri","stackng__DepartureFBO__r":"","stackng__Model_formula__c":"Challenger 650","stackng__FromCity__c":"Atlanta, GA","stackng__renderCrewNotes__c":false,"stackng__PaxActual__c":0,"Id":"a0F5f000001WqTvEAK","stackng__Aircraft_formula__c":"OH-WIW","stackng__Model__c":"a0C5f000018n30LEAQ","stackng__From__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeYVAA1"},"stackng__LocalName__c":"Hartsfield–Jackson Atlanta International Airport","stackng__ShortName_formula__c":"KATL/ATL (Atlanta, GA)","Id":"a015f00000DAeYVAA1","Name":"KATL/ATL - Hartsfield–Jackson Atlanta International"},"stackng__ArrivalFBO__r":"","stackng__ArriveTimeLocal__c":"12:05","stackng__DepartTimeTBC__c":false,"index":2,"stackng__Pax__r":[],"stackng__SegmentServices__r":[]},{"stackng__From__c":"a015f00000DAeTJAA1","stackng__ToIATA__c":"PDK","stackng__To__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeaVAAT"},"stackng__LocalName__c":"DeKalb–Peachtree Airport","stackng__ShortName_formula__c":"KPDK/PDK (Atlanta, GA)","Id":"a015f00000DAeaVAAT","Name":"KPDK/PDK - DeKalb–Peachtree"},"stackng__ToCity__c":"Atlanta, GA","stackng__ArriveDay__c":"Sun","stackng__ArriveTimeLocal12H__c":"7:35am","stackng__CrewNotes__c":"","stackng__PaxCount__c":3,"stackng__renderBaggageDetails__c":false,"stackng__Model__r":{"attributes":{"type":"stackng__Model__c","url":"/services/data/v62.0/sobjects/stackng__Model__c/a0C5f000018n30LEAQ"},"stackng__BaggageCapacity__c":"","Id":"a0C5f000018n30LEAQ"},"stackng__OperatorName__c":"Jetflite OY","Name":"Leg 3","stackng__FromCodes__c":"KVNY/VNY","stackng__To__c":"a015f00000DAeaVAAT","stackng__FromIATA__c":"VNY","stackng__DepartTimeLocal__c":"01:15","stackng__EBT_formula__c":"3h 20m","stackng__LegNumber__c":3,"stackng__ArriveDateLocal_text__c":"17-Nov-2024","stackng__DepartTimeLocal12H__c":"1:15am","stackng__FlightNumber__c":"","stackng__renderPaxNotes__c":false,"stackng__ToCodes__c":"KPDK/PDK","stackng__PassengerNotes__c":"","stackng__BaggageDetails__c":"","stackng__DepartDateLocal_text__c":"17-Nov-2024","stackng__DepartDay__c":"Sun","stackng__DepartureFBO__r":"","stackng__Model_formula__c":"Challenger 650","stackng__FromCity__c":"Van Nuys, CA","stackng__renderCrewNotes__c":false,"stackng__PaxActual__c":0,"Id":"a0F5f000001WqTwEAK","stackng__Aircraft_formula__c":"OH-WIW","stackng__Model__c":"a0C5f000018n30LEAQ","stackng__From__r":{"attributes":{"type":"stackng__Airport__c","url":"/services/data/v62.0/sobjects/stackng__Airport__c/a015f00000DAeTJAA1"},"stackng__LocalName__c":"Van Nuys Airport","stackng__ShortName_formula__c":"KVNY/VNY (Van Nuys, CA)","Id":"a015f00000DAeTJAA1","Name":"KVNY/VNY - Van Nuys"},"stackng__ArrivalFBO__r":"","stackng__ArriveTimeLocal__c":"07:35","stackng__DepartTimeTBC__c":false,"index":3,"stackng__Pax__r":[],"stackng__SegmentServices__r":[]}],"stackng__Contacts__r":[]}
For the attached templates:
- 400_EX_FlightBrief_A4.docx > This is a complex structure; However, earlier versions (not edited in a few months) work;
- stackng.docx > this only uses a single merge field from the JSON but still fails
- stack-flightbrief-long-map.docx > this is a template that works in the API (docx upload date 18 Oct 2024)
- FLight Brief Long.pdf > result of stack-flightbrief-long-map returned by API
Hope this helps narrow down the issue.
Copiar link para a área de transferência
Copiado
I used the JSON above and stacking.docx, and the Word Add-In, and I was able to generate the PDF (and it replaced the one tag). If you try that, but via API in code, does it fail?
Copiar link para a área de transferência
Copiado
Can it be OS related?
- MacOS Sonoma 14.6.1 (23G93)
- Word (for Mac) Version 16.91 (24111020)
- Not sure how to check the version of the plug-in but again... since this also happens through the application API on any 'newly saved' docx templates I am inclined to point to some sort of Word incompatibility...?
This is what I get when I run the stackng.docx template through the API:
ANd this from the Word plug-in
Copiar link para a área de transferência
Copiado
I want to be sure I understand, you are *only* testing via Word? Yes, it uses the API behind the scenes, but I thought you were also testing via API?
Copiar link para a área de transferência
Copiado
As an FYI, I tested on Mac, same Word version, but I'm on Sonama. Worked fine.
Copiar link para a área de transferência
Copiado
Sorry, I meant Sequoia.
Encontre mais inspiração, eventos e recursos na nova comunidade da Adobe
Explore agora