- 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-07-2023 01:23 AM
@AnveshKumar M Bro,
May need your help if go to option B, I am not much familiar with workflow script (I started from Flow Designer and rarely use Workflow).
I am not sure that how to get the output data from the New AD User - New Naming Convention (activity.output.output), and write script to remove '\n' and get a new Output for next activity designer use?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2023 05:57 AM
@AnveshKumar M Bro,
Finally, I can achieved it. You're right. We need to use the workflow scratchpad to store the variable and run the script to remove the '\n'.
I am delayed to reply due to I am not familiar with workflow much (I started from Flow Designer). I will mark accept solution for you.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2023 05:37 PM
@Bird1 I'm glad that it helped you 👍
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 07:16 PM
Hi @Bird1
In your custom workflow activity, you can include a step named "Post Processing." Within this step, you can add an Output process script where you use the replaceAll function to remove the character "\n."
Cheers,
Tai Vu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2023 08:27 PM
Could you please advise?
This is my output variable.
I've tried to add the post processing script like this
When I tried to run testing, it still shows \n prefix.