Handle when 'Get Rows' returns empty

Hello Good Community!

I have a scenario that processes records to determine the hours each employee should be paid for. At one point, the scenario uses a SQL Get Rows module to pull LOGOUT records. If someone never did a LOGOUT, there is no record to get.

Here are screen prints of the result. In the first screenprint, it shows a record that returns the logout information. In the second screenprint, it shows the result when there is no LOGOUT record. It seems like there should be a simple way for me to capture when an input record has no output so that I can process that record differently. Can I do that?

Screenprint where a LOGOUT record was returned:

Here’s what it looks like when no record is returned:

What do I have to add to be able to tell that a specific Employee # did not return a LOGOUT record?

Thank you for your assistance!!

Add a router module.

Route 1 filter: driverAct EXISTS

Route 2 filter: driverAct DOES NOT EXIST

samliew – request private consultation

Join the unofficial Make Discord server to chat with us!

2 Likes

I was thinking the same thing, but that doesn’t work.

In the current data set, there are seven records where one record doesn’t have a LOGOUT entry. When I do what you suggest, 6 records follow the path where driverAct EXISTS, but 0 records go to the driverAct DOES NOT EXIST route. I assume that is because when there is no LOGOUT record, there is no output bundle created. It’s not as if it lists out all the output fields with blank entries… This is what is in the output download for that record:

Any other ideas?

Ohh, there is no output bundle when there are no results.

Tough luck then. You’ll have to call the API manually using the universal module or HTTP module, and then parse the response, which will provide output bundle whether there are results or otherwise.

samliew – request private consultation

Join the unofficial Make Discord server to chat with us!

2 Likes

Tough luck then :rofl: :rofl: :rofl:

That’s why you’re the Maestro! Your guidance sounds like a great idea - but… I don’t know how to approach it. Do you have any example(s) you could point me to so that I can educate myself on this method and apply it to my issue?

Thank you!

If the external service has a Developer API Reference/Documentation then you should be able to integrate the endpoints in Make using the app’s universal module (Make an API call) or generic HTTP “Make a request” module.

If you need assistance in setting up the app’s universal module, or the generic HTTP module, please provide additional information about what you have tried with regards to the external service’s Developer API Reference – how you are setting the connection up, a link to the endpoint are you trying to connect to, and what errors you are encountering.

You can also complete this really helpful course/tutorial in the Make Academy on how to use external APIs — API calls with HTTP modules

  • API and Endpoints
  • Header and body
  • Multipart/form-data
  • OAuth 2.0

samliew – request private consultation

Join the unofficial Make Discord server to chat with other makers!

1 Like

I figured it out. There is a setting in the MySQL module that lets me say ‘yes’ to “Continue the execution of the route even if the module returns no rows”. This causes it to make an empty output bundle which allows me to keep going and identify when I didn’t get a matching record. Thank you everyone in the community for your help solving this!

2 Likes