Can we set RITM's value before ordering the catalog item?

BhagyashriS8790
Tera Contributor

I have created a rest api in service now which triggers a catalog item. I update the generated RITM's source field.
The source field on the RITM is used to identify whether the RITM was triggered through the API. 
In the workflow, I'm performing certain actions based on the 'source' field. 

but the issue is that the field gets updated later, while the workflow is checking it immediately. How can I ensure the workflow uses the updated value of the source field? Can we set RITM's value before ordering the catalog item?

1 ACCEPTED SOLUTION

Viraj Hudlikar
Giga Sage

Hello @BhagyashriS8790 

 

The field you mentioning is over RITM or is it variable?

If its field over RITM then you cannot set it when you call API. If its variable then while calling API do pass value for that variable and use it further.

Alternative you can try is in workflow the logic of checking value before happening try to keep wait or something so value is set and then you can utilize it further.

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

View solution in original post

5 REPLIES 5

Viraj Hudlikar
Giga Sage

Hello @BhagyashriS8790 

 

The field you mentioning is over RITM or is it variable?

If its field over RITM then you cannot set it when you call API. If its variable then while calling API do pass value for that variable and use it further.

Alternative you can try is in workflow the logic of checking value before happening try to keep wait or something so value is set and then you can utilize it further.

If my response has helped you hit helpful button and if your concern is solved do mark my response as correct.

 

Thanks & Regards
Viraj Hudlikar.

variable is of RITM and not of catalog item. 

Ankur Bawiskar
Tera Patron
Tera Patron

@BhagyashriS8790 

Even if that's a field on RITM table or variable within catalog item you are submitting, you can give some delay in workflow.

something like this in Run Script, put this after Start Activity

var secondsValue = 10;
var seconds = parseInt(secondsValue, 10) * 1000;
var start = parseInt(new Date().getTime()) + seconds;
while (start > parseInt(new Date().getTime())) {
    // do nothing
}

OR

You can use Wait for Condition and wait till the Source field gets updated and then proceed the workflow

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

@BhagyashriS8790 

Hope you are doing good.

Did my reply answer your question?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader