- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2024 10:56 PM
I have a requirement to create a select box variable which will be hidden on intake Form and Portal, that variable holds two values "Complex" and "Simple", this variable auto populate with the values based on other existing variable values i.e.,
var A is not empty,
var B is not empty,
Var C is YES and Var D is YES if these conditions met then we are setting the created variable value as "complex" otherwise "Simple".
Now, the issue is this is working for newly created records but not to the old records.
I need to update the existing records with the newly created variable and also need to get the value for those records based on above conditions.
Please advise as to what do I need to do in order to get the desired functionality here.
Thanks,
Saujanyae
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 02:03 AM
Hello @Saujanyae
Please refer the below logic and use it according to your usecase and if any consern then please reply back from this thread .
var grRecord = new GlideRecord("targetTable")
grRecord.query();
while(grRecord.next()){
if(variable A !="" && variable B !="" && variable C =="Yes" && variable =="Yes"){
grRecord.variable ="complex";
}
else{
grRecord.variable = "Simple";
}
grRecord.update();
}
Above script only for the existing records or Old records that has been in system
and also i just wanted to confime one things that you are using the record producer for this or for the catalog item ?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2024 02:03 AM
Hello @Saujanyae
Please refer the below logic and use it according to your usecase and if any consern then please reply back from this thread .
var grRecord = new GlideRecord("targetTable")
grRecord.query();
while(grRecord.next()){
if(variable A !="" && variable B !="" && variable C =="Yes" && variable =="Yes"){
grRecord.variable ="complex";
}
else{
grRecord.variable = "Simple";
}
grRecord.update();
}
Above script only for the existing records or Old records that has been in system
and also i just wanted to confime one things that you are using the record producer for this or for the catalog item ?
If my answer has helped with your question, please mark my answer as accepted solution and give a thumb up.
Thank You