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

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

118

Likes

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?

Likes

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

 

Likes

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.

Likes

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.

Likes

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

Likes

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.

Likes

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

Likes

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?

Likes

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.

 

Likes

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

LATEST

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.

Likes

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