Skip to main content

I am trying to update a variable at the end of a workflow.

Scenario: At the end of the workflow I want the contract number to be updated based on the manually updated attribute... Ex: Once the document gets sent to operations for processing I want the operations person to manually update the attributes.. From there I would like for the workflow to then update the variable and then update the corresponding Salesforce field. Currently I have a find document step, and I am confused.. do I just need to redefine the document variable? Meaning the document is deal_summary_doc and the existing variable I am updating is deal_Summary _doc? If so, how would I let the workflow know to grab the updated attribute and assign it to the correct variable and how would I define the document params with that new variable? Currently I have the update variable first then the find document next.

You can update a variable's value at anytime. Simply use an Update Variable Value Step, select the variable to update and then set the value to be the document's attribute. The end result should look something like this:

Screenshot_7_15_19__10_14_PM

I'm a little confused on what variable you're trying to update, though. You say that your document variable is deal_summary_doc, correct? And the variable you want to update is deal_Summary _doc? Is that a separate variable (and if so, the names should probably be a little more differentiated so you can distinguish them)? What kind of variable is it, Number? Regardless, you shouldn't need to re-define your document variable, only "refresh" it occasionally with a Find Document step, depending on the situation.

Once you've updated the variable with the contract number, you use that value to update Salesforce. There's no need to re-define the document params because the params are the data that go into your workflow. Once they're already in, they never need to be changed.


attributeI think I may be missing something.. The attribute is updated manually in the task window (see pic )..When I update the variable its not recognizing the new value I have set in the attribute..attribute 2


I don't see any attached pic, but I think I may know your problem. When you assign a document to a variable, you will see all its attributes and metadata. However, this is not "live" data, it's just a snapshot of the data at the time you assigned the variable. If the data in the document changes, the values in the document variable do not. Brilliant, right? Way to go, SpringCM.

So, in order to get the latest values, you have to do another Find Document step and re-assign the document to the same variable, thereby "refreshing" the values. You need to do this every time you are about to use data from inside the document variable and you know there is a chance it may have been modified since last assignment.


So I am changing the data by updating the attribute in the task view.. And when I do this youre saying that springCM does not recognize the updated value so I will need to redefine the document/variable for springCM to grab the new value..?

Currently this is how my workflow is set up. (see pic below)

attribute 3

In the find document step I redefined the document.. see below.

attribute4

Then I redefine the variable

attribute 2

Then I am updating the SF field

attribute 6

With this current process my variable is still not updating with the new value I manually updated in the attribute field. Any ideas?

Let me know if you can see the pictures..


Ok, now I see the images. So you do have the Find Document step to refresh the values. But in your Update Variable Value step, you are assigning the Params value to the variable. You should be assigning the attribute value (which is inside the Document variable, not the Params variable)

attribute


Hmm, I dont see that option available..

attribute 7

This is how I started my workflow.. I am defining my variables to my attribute group in the 5th step.. Do you know if I am missing a step? and that is the reason I dont have my doc attributes available as a choice?attribute 8


That's odd, that shouldn't be the internal structure of your document variable. Can you show me the Set Workflow Doc step? Are there any other steps where you may be assigning the Deal_Summary_Document variable to the value of the Params variable? Check all your Update Variable Value steps.


Have you updated the schema for your document variable? Open the variable, go to Edit Schema, Import from Spring then point it an example document.


variable 11

In the find document step I use to have params there but I am tried out this way to see if it would work.. of course its not.. variable 10variable 9

These are the 3 steps I am using the document in.. How I started this workflow was I kicked off the WF through doc generation.. filled out the fields.. and ran the WF. Then I grabbed the params and pasted them into the Deal_Summary_Document variable.. I am confused why you see attributes but yet I do not.. Do I need to define these in the params?


Yup, that first Set Workflow Doc step is the problem. You need to set *Document field to "Params", and then edit the schema like I have described above. We're close here, I think that's it.


I had it set to Params before but it wasnt working.. I re read our messages and I am not sure what you mean by edit the schema the way you have described above? Which thread are you referring too?

Sorry newbie here. I appreciate your help!


My apologies.. I missed this part of the conversation..

"Have you updated the schema for your document variable? Open the variable, go to Edit Schema, Import from Spring then point it an example document."

Let me try this out.


What do you mean when you say example document?


attribute 12


It worked!! I set the document to a previous test document.

Any suggestions on how I should go about this in the future? Storage of the example document I am using? etc.

Thank you so much again!


That's great, good news! You don't need to be concerned about storing your example document. You only need it once when setting the document schema. But I'm still concerned that in your first Set Workflow Document step, you aren't setting the Document to "Params". What is initiating your workflow, a DocLauncher?


Yes its a Doc Launcher template.


Yeah, then you should definitely be setting the Document to "Params". It's strange that it works at all the way you have it but it may cause problems down the line.


I added the params and its working. :)


Yay 🙌 😎


Very Cool, I use find document to refresh documents all the time.


Reply