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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Yass_Pbi
Frequent Visitor

Use Web.contents( ) with Query & RelativePath parameters for Json Data List in Power Query M

Hello,

 

I want to parametrize this URL using Relative Path and Query functions inside Custom M Function, here my URL and my code:

URL = "http://newapi.omni.com/1.13/Omni.svc/GetRelationListJson?json={TypeIDs: 10,ObjectID: "& property_id &",LanguageId: 2, CustomerName: CustName, CustomerPassword :Pass}"

property_id = Parameter used as Invoke Custom Function 

 

Source = (Property as number) as table =>

let
    property_id = Number.ToText(Property),
   

    Source = Json.Document(Web.Contents(URL_BODY,
   [RelativePath= "GetRelationListJson?json={TypeIDs: 10,ObjectID: "& property_id &",LanguageId: 2, CustomerName: CustName, CustomerPassword :Pass}"])),

......

 

This work only in Power BI Desktop, I have error in Power BI Service : [Unable to combine Data] ......

 

To fix this issue, I folowed CHRIS WEBB Blog, but unfortunately he didn't gave us an example with a json list.

I tried this, but it's not working: 

 

Source = Json.Document(Web.Contents(URL_BODY,
[RelativePath= "GetRelationListJson",
Query =
          [
            json=
                    {
                      TypeIDs= 1,
                      ObjectID= property_id,
                      LanguageId= 2,
                      CustomerName= "Cust",
                      CustomerPassword= "Pass"
                    }

            ]

 

Any idea on how to handle with list of Json inside Query function of URL please?

 

Thank's in advance for your help

6 REPLIES 6
v-tangjie-msft
Community Support
Community Support

Hi @Yass_Pbi ,

 

You can go to:

File=>Options and Settings=>Options and set the Ignore Privacy Levels option.

 

If 'Privacy Settings' can not be your workaround, maybe you can try to use data flows.

For more information, you can refer:

https://www.meanttobi.com/power-bi-refresh-error-unable-to-combine-data-workaround/

 

You can refer to the following posts that may be helpful to you:

Online Refresh Error when desktop refresh works fi... - Microsoft Power BI Community

 Define and invoke function within query - Microsoft Power BI Community

 Unable to Combine Data - Custom Function - Microsoft Power BI Community

 

Best Regards,

Neeko Tang

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

Hello @v-tangjie-msft ,

 

Thank for different links.

 

I've tried all these workaround before, Unfortunately I have the same error in Power BI Service:

1. Combine all different queries in single one query.

2. Use Query parameter with Relative Path in URL

3. Set Privacy Setting in PBI Desktop to (Always Ignore Privacy Level).

 

 

 

Hi all,

 

It works only with DataFlow, which means I need to upgrade all the licenses of my customer (Pro to PPU). It's very weird that we are obliged to use DataFlow to handle with this issue

Hi @Yass_Pbi ,

 

Has your problem been solved? If the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out. Thanks in advance.

 

Best Regards,

Neeko Tang

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

Hello @v-tangjie-msft ,

 

I found a workaround ( Using DataFlow), so it's not solved yet with Power Query.

 

Best regards, 

Yass_Pbi
Frequent Visitor

I tried this: 

Source = Json.Document(Web.Contents(URL_BODY,
[RelativePath= "GetRelationListJson",
Query =
          [
           json=
           "{
              ""TypeIDs"": ""1"",
               ""ObjectID"":" & property_id&",
               ""LanguageId"": ""2"",
               ""CustomerName"": ""Cust"",
               ""CustomerPassword"": ""Pass""
               }"

            ]
      ])),

 

It works in PBI Desktop, but I'm facing the same error in PBI Service: 

[UNABLE to Combine Data] ............ 

 

Anyone can help please?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

April Fabric Community Update

Fabric Community Update - April 2024

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

March 2024 PBI Gallery Image

Power BI Monthly Update - March 2024

Check out the March 2024 Power BI update to learn about new features.

Top Solution Authors
Top Kudoed Authors