Create A Task with fields / variables dynamically not listed to Cat Item

Markell
Tera Guru

OK So I wasnt sure how to word this 😖

Basically I want to:

1. Create a task. 

2. Have variables for that task BUT I dont want to have to use a pre-created field either from the Cat Item Slush Bucket or on the Task Table.

 

In essence, is there a way to either call a field (maybe a variable set) without having to have that variable set linked to the cat item? Or, create almost temp fields for that task instance to be used?

 

I have seen the following posts on similar topics:
Solved: Dynamically Add Variables to A Task (Flow Designer... - ServiceNow Community
Adding Variables to a Task via a script instead of... - ServiceNow Community

But both (seem) to require the fields to be associated to the RITM / Cat Item.


Is what I am thinking possible?

1 ACCEPTED SOLUTION

@Markell,

 

If my understanding is correct, and this 'variable' is a data point that requires  input by a user in the task stage, I'm not sure how you can navigate around this.

Assuming the initial request is triggered by a request (Eg User provisioning as a typical use case), I would create a variable (variable set) at the Item level which could then be used as the task stage to collect and store input.

This will allow full reporting and visibility.

 

Obviously, just guessing and thinking out loud here.

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

View solution in original post

9 REPLIES 9

Robbie
Kilo Patron
Kilo Patron

@Markell - How are you bud? Hope all well.

 

You know me, I love tricky questions... but this one definitely raises a lot more questions than answers initially.

Putting a lot of the questions aside, say you did create a variable (or variable set) that is not tied to cat item, how do you visualise storing or pulling the data from the variable? 

Variables are principally tied to a cat item and of course store the values which can be pulled upon by the instance (the cat item) that is inserted. How would the temp variables you create have different instances or store different values?

Thinking out loud, how temporary is this value you need? Can it be associated with the users session or maybe scratchpads? (A lot of questions here....)

Maybe a Cat Item that itself is temporary, but you'd need to manage this re clearing values etc.. .this all sounds a bit abstract and not best practice... (But I do love 'out there questions)

 

Can you give a simply use case or example?

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

Hello Robbie, hope you are well.

Yea It was more of a Hail Marry, but I just wanted to create a bit of a 'drag and drop'  subflow and part of it was including a task that needs to update the same values in the group table each time.

 

Im ok ading the variable set to each cat item build tbh. Just wanted to know if there was a way of doing this without having too.

@Markell,

 

If my understanding is correct, and this 'variable' is a data point that requires  input by a user in the task stage, I'm not sure how you can navigate around this.

Assuming the initial request is triggered by a request (Eg User provisioning as a typical use case), I would create a variable (variable set) at the Item level which could then be used as the task stage to collect and store input.

This will allow full reporting and visibility.

 

Obviously, just guessing and thinking out loud here.

 

To help others (and for me to gain recognition for my efforts), please mark this response correct by clicking on Accept as Solution and/or Kudos.


Thanks, Robbie

Upon further thinking. My requirement really is how can I have this so that it works across various Cat Items.

 

Lets say I have a Cat Item for "Laptop" and another for "IPhone"

I want a flow that can be used for either.

I then also want within that flow a task that can call a set of questions, regardless of which Item was selected, without me having to specifically select the cat item in that flow?

Markell_0-1744039760947.png