Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

REST API HELP

We are trying to extract Incident ticket data from ServiceNow to Power BI using Rest API. We are able to bring Incident tickets data from ServiceNow but our client requirement is,

 

We have Table called ‘X’ in Power BI and in that table have Incident number column and which is having latest to 2 year old data.

 

Now we need to have functionality like, pick the incident number from X table and that Ticket number should validate and bring matching data from ServiceNow RESTAPI. It means, whatever the data we have in X table only those incidents should come from ServiceNow REST API.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

Currently, you are succeed to get data from ServiceNow to Power BI using Rest API. Now your requirement is to filter data by incident number in Table X.  Try to update your api to invoke incident number list from Table X.

Here I a sample query to get version from sharepoint by api.

 

let
    Source = (VersionsRelevantSharePointListName as text, VersionsRelevantSharePointLocation as text, VersionsRelevantItemID as number) => let
        Source = Xml.Tables(Web.Contents(Text.Combine({
    VersionsRelevantSharePointLocation,
    "/_api/web/Lists/getbytitle('",
    VersionsRelevantSharePointListName ,
    "')/items(",
    Text.From(VersionsRelevantItemID),
    ")/versions"}
    ))),
        entry = Source{0}[entry],
        #"Removed Other Columns2" = Table.SelectColumns(entry,{"content"}),
        #"Expanded content" = Table.ExpandTableColumn(#"Removed Other Columns2", "content", {"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"}, {"content"}),
        #"Expanded content1" = Table.ExpandTableColumn(#"Expanded content", "content", {"properties"}, {"properties"}),
        #"Expanded properties" = Table.ExpandTableColumn(#"Expanded content1", "properties", {"http://schemas.microsoft.com/ado/2007/08/dataservices"}, {"properties"})
    in
        #"Expanded properties"
in
    Source

 

It looks like as below.

1.png

Invoke list with this query and add parameters into query, then expand the table to get your result.

1.png

So you just need to filter incident number list from X table to filter the result in power query.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

 

View solution in original post

3 REPLIES 3

Hello,

Much easier way would be using out Power BI Connector for ServiceNow app:

We have a handy User and Admin Guides for your convenience, but feel free to reach out support team at support@alpha-serve.com if you need any assistance.

 

Thank you.

Regards,

Anton

===

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

Hi @Anonymous 

Currently, you are succeed to get data from ServiceNow to Power BI using Rest API. Now your requirement is to filter data by incident number in Table X.  Try to update your api to invoke incident number list from Table X.

Here I a sample query to get version from sharepoint by api.

 

let
    Source = (VersionsRelevantSharePointListName as text, VersionsRelevantSharePointLocation as text, VersionsRelevantItemID as number) => let
        Source = Xml.Tables(Web.Contents(Text.Combine({
    VersionsRelevantSharePointLocation,
    "/_api/web/Lists/getbytitle('",
    VersionsRelevantSharePointListName ,
    "')/items(",
    Text.From(VersionsRelevantItemID),
    ")/versions"}
    ))),
        entry = Source{0}[entry],
        #"Removed Other Columns2" = Table.SelectColumns(entry,{"content"}),
        #"Expanded content" = Table.ExpandTableColumn(#"Removed Other Columns2", "content", {"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"}, {"content"}),
        #"Expanded content1" = Table.ExpandTableColumn(#"Expanded content", "content", {"properties"}, {"properties"}),
        #"Expanded properties" = Table.ExpandTableColumn(#"Expanded content1", "properties", {"http://schemas.microsoft.com/ado/2007/08/dataservices"}, {"properties"})
    in
        #"Expanded properties"
in
    Source

 

It looks like as below.

1.png

Invoke list with this query and add parameters into query, then expand the table to get your result.

1.png

So you just need to filter incident number list from X table to filter the result in power query.

 

Best Regards,

Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. 

 

 

lbendlin
Super User
Super User

Add a custom column to your table, construct the URL for the incident in each row and then use Web.Contents to pull the individual records.  Then expand that new column as needed. Is the data in XML or in JSON?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors