web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Need understanding on ...
Power Automate
Unanswered

Need understanding on how to connect service now with power automate

(0) ShareShare
ReportReport
Posted on by 56

Facing issues to create a new service request in client service now tool using Power Automate.

 

Error message shows 

"body": {"error": {"message":"Operation Failed","detail":"ACL Exception Insert Failed due to security constraints"},"status": "failure"}

 

Kindly assist.

Categories:
  • nitishsh91 Profile Picture
    200 on at

    Hi @rishabhkhanna1 

     

    I had a similar error yesterday and its was due to access being changed on my user account which I was using to raise incidents in service now.

    Here are a few things you can check to resolve the issue:

    1. Check the access controls for the target table in ServiceNow. Make sure that the user account you are using has the necessary roles and permissions to create records in that table.

    2. Verify that the target table name in your Power Automate flow matches the table name in ServiceNow exactly. Any discrepancies in table names can cause this issue.

    3. Check if there are any mandatory fields or data validation rules for the target table in ServiceNow. Make sure that you are providing all the required data for creating a new record, and that the data provided meets any validation rules.

    4. Verify the authentication details that you are using in your Power Automate flow to connect to ServiceNow. Make sure that the user account and authentication method you are using have the necessary access to create records in the target table.

    5. If the issue persists, try creating a new service request manually in ServiceNow using the same user account that you are using in the Power Automate flow. This can help you identify any issues with the user account or target table in ServiceNow.

  • rishabhkhanna1 Profile Picture
    56 on at

    Hi @nitishsh91 ,

     

    Thanks a lot for your response.

     

    Any thoughts on how to check access controls in service now? Do we need higher access to service now to check that?

     

    How do we validate Table name from Service Now ? Any API Calls needed as such to check?

     

    Also, we have a service account that we are using to authenticate Power Automate flow with service now, although unable to login to service now/office.com using those credentials.


  • nitishsh91 Profile Picture
    200 on at

    You can use username and password using Powershell to query for a particular table using API and see if you are able to fetch the data or not. It will give you an error or something if that doesn't work.

    If you have access, login to service now using your id and search for API user and look at the activity history if there has been any change in policies off late.

     

  • rishabhkhanna1 Profile Picture
    56 on at

    Can you help me understand on how to connect with Powershell for next steps ?

  • nitishsh91 Profile Picture
    200 on at

    Here you go:

    I tested logging an incident in service now, you can modify it to fetch details of any incident:

    # Set the credentials
    $User = ''
    $Pass = ''

    # Set headers
    $GlobalHeaders = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
    $GlobalHeaders.Add('Accept', 'application/json')
    $GlobalHeaders.Add('Content-Type', 'application/json')

    # Build & set authentication header
    $base64AuthInfo = [Convert]::ToBase64String([Text.Encoding]::ASCII.GetBytes(("{0}:{1}" -f $User, $Pass)))
    $GlobalHeaders.Add('Authorization', ('Basic {0}' -f $base64AuthInfo))

    # Load variable with ServiceNow instance URL
    $ServiceNowInstance = 'service now instance url'
    # Load a variable with the incident table API endpoint
    $CreateIncidentURL = "$ServiceNowInstance/api/now/table/incident"
    # Service Desk assignment group sys_id
    $AssignmentGroup = ''

    Function Add-Ticket {
    # Load a variable with data for the description field
    $MessageBody = "This is a test incident to test call-out."
    # Load a variable with data for the short description field
    $ShortDescription = ""
    $incidentBody = @{
    "short_description"= $ShortDescription;
    "urgency"= "2";
    "impact"= "2";
    "business_service" = "";
    "assignment_group" = "";
    "cmdb_ci" = "";
    "description" = $MessageBody;
    "caller_id" = "userid";
    "contact_type" = "auto";
    }

    # Body used to pass the fields I will pupulate within the ticket - there are several, see the docs
    $Params = @{
    Headers = $GlobalHeaders
    Method = "POST"
    Uri = $CreateIncidentURL
    Body = ($incidentBody | ConvertTo-Json)
    }


    Try {
    Invoke-WebRequest @ParamS -UseBasicParsing -ErrorAction Stop
    }
    Catch {
    # Handle any errors
    }
    }
    # Run the function, Add-Ticket
    Add-Ticket

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
11manish Profile Picture

11manish 321 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 244

#3
Henil Profile Picture

Henil 102

Last 30 days Overall leaderboard