Github integration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
9 hours ago
I have a multirow variable set within that there is a variable called accept/reject , I need these values to be changed from github. For some reason it doesnt allow me to do that , how is that possible to do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago
Hi sharmadhruv,
To give you a precise answer, we need a bit more detail on how the integration is set up. However, I can point you to the most common reason why this fails.
The Likely Issue: MRVS Data Structure Unlike standard variables, you cannot simply target a variable inside a Multi-row Variable Set (MRVS) directly (e.g., current.variables.mrvs_name.accept_reject = 'true' will not work).
ServiceNow stores the entire Multi-row Set as a JSON String. To update it via any integration (Scripted REST API, Flow Designer, or Business Rule), you must follow this pattern:
Get the full JSON string from the MRVS.
Parse it into a JavaScript Array.
Find the specific row index you want to update.
Update the object.
Stringify it back to JSON and save.
Example Script (Server-side): Assuming your integration triggers a script on the RITM:
// 1. Get the current JSON string from the Multi-row Variable Set internal name var mrvsString = current.variables.your_mrvs_internal_name.toString(); var mrvsArray = []; if (mrvsString) { // 2. Parse into Object mrvsArray = JSON.parse(mrvsString); } // 3. Logic to find the correct row (e.g., updating the first row, or finding by ID) // Here we are updating ALL rows, but you can add an 'if' condition for (var i = 0; i < mrvsArray.length; i++) { // 4. Update the variable value mrvsArray[i].accept_reject = 'Accept'; // Use the variable name, not label } // 5. Stringify back and save current.variables.your_mrvs_internal_name = JSON.stringify(mrvsArray); current.update();
If this doesn't help, please clarify:
How does GitHub trigger ServiceNow? (Webhook to Scripted REST API? Flow Designer Action?)
How do you identify which row in the multi-row set needs to be updated?
If this response helps you solve the issue, please mark it as Accepted Solution.
This helps the community grow and assists others in finding valid answers faster.
Best regards,
Brandão.
