- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 01:40 AM - edited 10-05-2023 01:41 AM
Hi Experts,
I have created new action in the flow, when I testing that action in action level it working as expected(getting expected output) but when add that action in the main flow I am getting below error.
Error: o,Detail: Unexpected token: o
Can you please help me to resolve this issue
Here is script and I am passing input as a string
(function execute(inputs, outputs) {
var rs = JSON.parse(inputs.response);
outputs.groupoutput = extractGroupNames(rs);
function extractGroupNames(response) {
var groupNames = [];
if (response && response.MemberOf) {
for (var i = 0; i < response.MemberOf.length; i++) {
var match = response.MemberOf[i].match(/CN=([^,]+)/);
if (match && match[1]) {
groupNames.push(match[1]);
}
}
}
return groupNames;
}
})(inputs, outputs);
Many thanks,
NS
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 04:18 AM
Hi Experts,
I am able to resolved it.
Solution- Instead of passing input as a string I passed it as a JSON and it worked and make some changes in script, here is my final working script.
(function execute(inputs, outputs) {
var rs = inputs.response;
outputs.groupoutput = extractGroupNames(rs);
function extractGroupNames(response) {
var groupNames = [];
if (response && response.MemberOf) {
for (var i = 0; i < response.MemberOf.length; i++) {
var match = response.MemberOf[i].match(/CN=([^,]+)/);
if (match && match[1]) {
groupNames.push(match[1]);
}
}
}
return groupNames;
}
})(inputs, outputs);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 01:45 AM
Please make sure that you have published the action before use in flow and send the proper parameters whatever is required.
If my answer solved your issue, please mark my answer as ✅ Correct & 👍Helpful based on the Impact.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-05-2023 04:18 AM
Hi Experts,
I am able to resolved it.
Solution- Instead of passing input as a string I passed it as a JSON and it worked and make some changes in script, here is my final working script.
(function execute(inputs, outputs) {
var rs = inputs.response;
outputs.groupoutput = extractGroupNames(rs);
function extractGroupNames(response) {
var groupNames = [];
if (response && response.MemberOf) {
for (var i = 0; i < response.MemberOf.length; i++) {
var match = response.MemberOf[i].match(/CN=([^,]+)/);
if (match && match[1]) {
groupNames.push(match[1]);
}
}
}
return groupNames;
}
})(inputs, outputs);