- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 06:46 PM - edited 12-17-2023 05:58 AM
Hello,
I need 1 help. I do have Powershell Script to create Active Directory account, so I create 'activity designer' and embed the Powershell script there. The output is set as 'Direct'.
So far, the Powershell Script works well, it could create Active Directory account but I faced the Output in that activity designer, it will always add '\n' as prefix so like below captured screen, the script could create Active Directory account: 'mit' but the Output will show as '\nmit'.
I will really need this output to be the input of the next activity, so it will be failed because of '\n' prefix.
I am not sure is there any way to
A) remove the '\n' either from the output
B) if the choice A) to remove '\n' from the output of current activity is not possible, can we remove '\n' from the input of the next activity designer instead?
PS: I have tried the same Powershell Script adding to action designer on the Flow Designer, there's no problem, it could return output as 'mit' without '\n' prefix, so the problem is only from Activity Designer's workflow
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 06:59 PM
Hi @Bird1
Coming to the option B,
You can have a Script Activity and use the replace method on the output string. Like YourVariable.replace("\\n", ""); and store it into a scratch pad variable for use in other work flow activities.
If the above one didn't work, try just \n instead of \\n.
Please mark my answer helpful and accept as a solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 06:59 PM
Hi @Bird1
Coming to the option B,
You can have a Script Activity and use the replace method on the output string. Like YourVariable.replace("\\n", ""); and store it into a scratch pad variable for use in other work flow activities.
If the above one didn't work, try just \n instead of \\n.
Please mark my answer helpful and accept as a solution if it helped 👍✅
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 10:50 PM
Hi AvneshKumar,
Is it possible if I choose option A to add output post processing script? I tried below one but still get the '\n' as prefix.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 11:31 PM
@Bird1 Have you tried the "\\n".
activityOutput.Output = activityOutput.Output.replaceAll("\\n", "");
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-06-2023 01:00 AM
I've tried to update to activityOutput.Output = activityOutput.Output.replaceAll("\\n",""); but still get '\n' prefix.