grabbing inputs that are generated from @autocomplete queries
I have hit this hurdle several times now where my runbook cannot see the data from a field using the @autocomplete.
what exactly needs to be done so the runbook can see the data in the input.
in this case I created a new class to get all the Collections from SCCM. The query work perfectly providing the collections. When you select a collection and save, the runbook fails because there is no collection passed to it from the field.
Answers
@alex_kokin - You have 2 options. Either fetch the Related Item(or Affected Item depending on which relationship you configure the Query Result prompt to use), or have a step in the runbook that parses the UserInput property of the SR and pulls out the answer to the SCCM Collection prompt.
Hi @alex_kokin
I just recently ran into this problem myself. I wrote this powershell to grab the data out from the user input field. In this script I have an example of the data at the top saved to a string which parses it out and puts it in variables I return from the runbook activity to use in other steps. Let me know if you have any questions about it.
I also have a similar PS script.
This script will take the user input and break it down by types to return a question and answer array.
but when needed to pull specifics out I create the variable in the specific section. The script pulls out the CI user GUID that you can then pass to the next step of the runbook to Get-Object AD user to pull all their CI data. Also have the User input in @" "@ to account for users typing weird stuff into the free form txt boxes.
HTH