Skip to main content
shaikg2747
June 23, 2023
Question

How to get ID by generating PDF document!!!

  • June 23, 2023
  • 8 replies
  • 0 views

Hi all,

Actually, by using Dynamic DOCX Template I am generating a PDF.

Now I want that PDF ID to save in a process model.

I tried by creating a process variable of type number integer and tried saving the generated document from the plugin into the process variable and didn't work out!!

Can someone suggest me how can I achieve this.

Thanks In Advance.

8 replies

harshitb6843
June 23, 2023
  1. Make sure the smart service is not giving any errors. There are cases when the node will complete without the visible error but the out variable "Error" will tell you a different story. Store the error in some variable to check if everything is fine. 
  2. Try changing the type of that variable from int to doc. 
  3. Make sure no other nodes are overriding your variable and setting it back to null. 
shaikg2747
June 23, 2023

Yeah, 

1. there are no errors, and I am trying to save the errors too for reference.

2. I am already saving the PDF in a document but I need the ID of that PDF document.

3. Yeah, the nodes are not overriding.

mikes0011
Brainy
June 23, 2023

The "Document" type PV already (actually) contains the document ID - Appian just shows us the document's name to be "user friendly" - but this can be cast to INTEGER type at any time we need - you could just use a subsequent script task to save that PV directly into an INTEGER type variable and you'd have it.

But yes if you want/need to save the ID directly at save time, all you need to do is add an extra node output entry, just below the place you (already) have it configured to save into pv!newDocumentCreatedPDF:

The Expression Guru
mathieud0001
Brainy
June 23, 2023

Did you try creating a pv of type Document instead?

shaikg2747
June 23, 2023

Yes, and also saving the generated PDF in one of our folder also. But my requirement is to get the generated PDF document in the same process model, and I need to utilize that ID for an integration.