SamiraJavdani | Posts: 6

Retrieve Field Summary at Document Level

0 votes
Hello, Using below retrieves a list of field values at the package level. But is it possible to retrieve the field values for a particular document? eslClient.getFieldValues(packageId) Thanks

Duo_Liang | Posts: 3776

Reply to: Retrieve Field Summary at Document Level

0 votes
Hi there, Simply use this code snippet to loop through all the fields:
		EslClient eslClient = new EslClient(API_KEY, API_URL);
		PackageId packageId = new PackageId("package_id");
		String documentName = "document_name";

		Document document2 = eslClient.getPackage(packageId).getDocument(documentName);
		for (Signature signature : document2.getSignatures()) {
			for (Field field : signature.getFields()) {
				System.out.println(field.getStyle() + " : " + field.getId() + " : " + field.getName() + " : " + field.getValue());
			}
		}
This will print out all the fields with or without value while for the eslClient.getFieldValues(packageId) function, it only returns fields with values and returns fields in all documents. Duo

Hello! Looks like you're enjoying the discussion, but haven't signed up for an account.

When you create an account, we remember exactly what you've read, so you always come right back where you left off