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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Anonymous
Not applicable

Amend API query to return multiple statuses

Hi 

I'm new to Power Query and have written the following to extract data from a time recording app we use called Clockify.

 

(Page as text) =>

let
Source = Json.Document(
Web.Contents("https://api.clockify.me/api/v1" & "/workspaces/"& Workspace&"/approval-requests?page="&Page&"&page-size="&PageSize&"&status="&Status,
            [Headers=[#"X-API-Key"=#"X-API-Key", 
                     #"Content-Type"="JSON"]]
                                      )
                                       ),

I need to return records for all status codes (APPROVED,PENDING,REJECTED,WITHDRAWN_APPROVAL) however I don't understand how to structure the query to include an OR clause. At the moment I have a parameter called Status and the query works fine  if populate with one of the statuses e.g. APPROVED. The API has a default value of PENDING, so only returns those records if Status is omitted from query.

 

Be grateful for any help or advice anyone can offer.

Best regards

Mark

 

 

 

 

 

 

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Does the documentation for this API provides the syntax for or ? Alternatively, you can make a one column table of the your status values and then invoke your function in a new column, passing the status values in on each row.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi Pat

 

I have questioned the syntax provided by Clockify and they now advise that returning multiple status is not supported so request must be made for each status separately.

 

I will close this query now and go away and research how I can do this, and submit another question if I can't figure it.

 

Thanks again 

 

Mark

 

 

Anonymous
Not applicable

Hi Pat 

Thanks for the reply.

 

The syntax I've been provided with is as follows

 

CORB_0-1646735993003.png

 

I've tried passing everything following the "=" sign in the parameter but only get records returned for the first status.

 

Could you please elaborate on your suggestion regarding the one column table as it's above my current level of knowledge.

 

Many thanks for your help.

 

Best regards

 

Mark

 

 

 

 

 

mahoneypat
Microsoft Employee
Microsoft Employee

Does the documentation for this API provides the syntax for or ? Alternatively, you can make a one column table of the your status values and then invoke your function in a new column, passing the status values in on each row.

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors