• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Adobe Doc Gen - It seems there was an error on the server

New Here ,
Oct 29, 2022 Oct 29, 2022

Copy link to clipboard

Copied

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"
				}
			]
	}
]

 

 

adobe_error.png

TOPICS
Bug , Document Generation API , PDF Services API

Views

951

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Nov 01, 2022 Nov 01, 2022

Copy link to clipboard

Copied

Are you still getting this error now? Can you share the Word doc?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 01, 2022 Nov 01, 2022

Copy link to clipboard

Copied

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 

 

adobe_doc_gen_1.png

 

adobe_doc_gen_2.png

 

 

adobe_doc_gen_3.png

Thanks

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 02, 2022 Nov 02, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 02, 2022 Nov 02, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2022 Nov 02, 2022

Copy link to clipboard

Copied

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:

OwnerIDPropertyIDProperty AddressRentBedroom
L001P00112 St LA3002
L001P0023 St SA4503
L002P0034 St SA5004
L003P00420 St LA4002

 

Thanks

Jag

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 02, 2022 Nov 02, 2022

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

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:

https://powerusers.microsoft.com/t5/Building-Flows/Convert-Excel-to-Json-with-Nested-Array/m-p/18456...

 

Could you please share what changes need to be made in the json. Probably a sample template will help please.

 

Thank you.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Nov 03, 2022 Nov 03, 2022

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 28, 2023 Oct 28, 2023

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Oct 30, 2023 Oct 30, 2023

Copy link to clipboard

Copied

LATEST

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. 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources