From Logic app how to pull data from ServiceBus Queue based on conditions like a specific date range and a data field?

Sherby Rodrigues 0 Reputation points
2023-04-17T00:44:07.3666667+00:00

Requirement is: From Logic App to pull data from the Service Bus Queue based on the date range that I pass to the queue. Do not remove data from the queue after fetching it. Please assist with the following:-

  1. Which component could I use?
    1. Tried with Service Bus Queue component but do not know which trigger or action to choose
  2. How to pass the data range parameter from Logic App in the component that matches with one of the property in the queue data? In short, only to retrieve data for a specified date range or date?
  3. Do not remove data from the service bus queue after reading it.
Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
559 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
2,900 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 69,581 Reputation points
    2023-04-26T02:28:03.8866667+00:00

    @Sherby Rodrigues Thanks for reaching out.

    Unfortunately, there is no out of box of feature for your requirement. There is no option to read the messages by providing the data range and get the messages that were sent only during a particular date range. The EnqueuedTimeUtc or ScheduledEnqueueTimeUtc is the property of the message as documented here so you can only get the details when you read the individual messages.

    The only workaround would be peeking all the messages in the queue and then check EnqueuedTimeUtc or ScheduledEnqueueTimeUtc time of individual message and then verify if it falls under your datetime range. If yes then further process your business logic.

    Workflow: Peek All messages --> Condition to check if the EnqueuedTimeUtc or ScheduledEnqueueTimeUtc falls under your daterange --> if yes further process your business logic

    Feel free to get back to me if you have any queries or concerns.

    0 comments No comments