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.
635 questions
Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,211 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 70,536 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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.