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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
v-rzhou-msft
Community Support
Community Support

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.

v-rzhou-msft
Community Support
Community Support

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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