How to update a document into user records through process model

Hi i am new to appian , I have been working on a activity where I have to generate document through ms doc from template smart service. This document generation was happening in a subprocess from there I am greeting the generated document id to parent process I am not sure whether this flow going right or not .Now I need to update this id to record for particular user like based on their profile id I need add this document which they will be able download through interface which will be another big task for a beginner . Can anyone guide me?

  Discussion posts and replies are publicly visible

  • 0
    Certified Senior Developer

    Hi   may I see your process model design,  generic approach would be when a action is generated capture the Id of that user into process variable, after once document id is generated, use a script to and update your record details by storing the user id and document id and pass that your write record smart service 

    • Hi   My process model have 11 subprocess defined for different different technology so based on the profile id and the technology one subprocess will be start from there it need to updated to record so I am confused whether to use one write record ss for all Or for each sub process each write records and I didn't know the correct expression for script task I am new to this 
  • 0
    Certified Senior Developer
    in reply to iswaryan3520

    I am not sure if you have 11 different database tables just for the differentiation of technology. If so, please re-think you approach by having a single table with an column/field for distinguishing the technology id coming from the reference data.

    Coming to your question please use a script task post your document generation subprocess and use the a!update() function where the data would be your process variable and the index would be the document field and the value will be your document id. you will have to use match and select the pv based on the technology. (Not a good idea unless you have no options)

    Please share your process design and also share us what make these 11 subprocess different, is it just the technology based record do you have any fields that vary.