Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 8PaqigmFs0PhgLveMZPGO5
Power Apps - Building Power Apps
Answered

Problem sending message to Azure Service Bus queue

Like (0) ShareShare
ReportReport
Posted on 22 Nov 2016 08:43:48 by

Hi,

 

I'm trying to send a simple test message to Azure Servive Bus queue from PowerApps, but I'm having problems with Properties -table syntax.

 

AzureServiceBus.SendMessage("tilastointiqueue"; {

ContentData:"Some text";

ContentType:"String";

ContentTransferEncoding:"base64";

Label:"Heading";

Properties:Table( {Name:"name1", Value: 1},{Name:"name2", Value:2} )

} )

 

Error says that Column with type Text is missing, but I can't find a way to fix it.

 

I am able to send the message to queue without Properties-parameter, but the ContentData doesn't seem to be transferred with the message since the Message Text is empty.

 

Has somenone send messages to Service Bus queue succesfully?

 

 

Categories:
  • Community Power Platform Member Profile Picture
    on 25 May 2021 at 21:44:09
    Re: Problem sending message to Azure Service Bus queue

    You can send custom properties in a Power Apps Service Bus connector SendMessage call using the Properties parameter. The Properties parameter takes a Table with specific rows of key and value pairs.

    I didn't find the ContentData parameter well documented. In my testing it takes a data URI string value with mandatory base64 encoding. Unfortunately there is no built in way to base64 encode in a canvas Power App. If the parameter value isn't properly formatted the resulting Servivce Bus queue message will have an empty ContentData value. Below is an example that sends a new message to the queue, setting the broker property: Label, and three custom properties, along with the text "Hello world!" in the ContentData parameter.

     

    Example:

     

    ServiceBus.SendMessage("p1imagecaptureevents",
    {ContentType:"text/plain"
     ,Properties:Table (
     {key: "Label", value: "labelvalue2"}, 
     {key: "myFirstFieldName", value: "'My first field's value8'"}, 
     {key: "mySecondFieldName", value: "My second field's value5"}, 
     {key: "myOtherFieldName", value: "More values5"})
     ,ContentData:"data:text/plain;base64,SGVsbG8gd29ybGQh" // "Hello world!" base64 encoded text
    })

     

  • Community Power Platform Member Profile Picture
    on 08 Mar 2019 at 19:19:05
    Re: Problem sending message to Azure Service Bus queue

    @wjhepworth Very scientific! Have you had any success parsing out the Properties parameter within Logic Apps? Specifically the table values that can get passed in using the "key &  value" format you provided. I have not had any success with it myself, so far.

    Thanks --SP

  • Community Power Platform Member Profile Picture
    on 07 Mar 2019 at 21:29:42
    Re: Problem sending message to Azure Service Bus queue

    Honestly, it was a case of researching and experimentation and asking myself reallly exactly what the error messages meant.  There was all kinds of documentation talking about the fact that the Properties attribute existed but none specifying was would go in there.  Turns out I kept getting and error message saying it was missing 'key' and 'value' fields.  At first I converted my initial appraoch to just repeat rows with Key / Value paires thinking that would work. When it still guessed they were case sensitive on those fields and sure enough that worked.  Glad it helped.

  • Community Power Platform Member Profile Picture
    on 07 Mar 2019 at 19:11:30
    Re: Problem sending message to Azure Service Bus queue

    @wjhepworth  I am super grateful for your response. It worked for me. Curious, where/how did you find-out that it is required to pass the table in this format?

  • Verified answer
    Community Power Platform Member Profile Picture
    on 13 Feb 2019 at 15:59:47
    Re: Problem sending message to Azure Service Bus queue

    So I encountered this recently and have a few notes in case anybody needs them.  They don't appear anywhere else it seems.

     

    First, if you are trying to pass JSON it may be easier to go with the Properties parameter which is reflected on the Service Bus trigger's UserProperties when the Service Bus listener picks it up on the other end.  The trick is, the Table that it expects must be in the form of:

     

    Table (
        {key: "myFirstFieldName", value: "My first field's value"}, 
        {key: "mySecondFieldName", value: "My second field's value"}, 
        {key: "myOtherFieldName", value: "More values"}
    }

     

    The trick is.. there must be two fields and both in lower case: 'key' and 'value'.  If not you will get a cryptic message (though truthful) that you are missing a column 'key' of type Text.  I didn't see this in any documentation so thought I would share.
     


  • v-micsh-msft Profile Picture
    on 09 Feb 2017 at 01:58:18
    Re: Problem sending message to Azure Service Bus queue

    Hi @Anonymous,

     

    Thanks for the update and sharing.

    Regards

  • Community Power Platform Member Profile Picture
    on 08 Feb 2017 at 10:01:52
    Re: Problem sending message to Azure Service Bus queue

    This issue was caused by my language setting (Finnish). Sending message with Properties-table to Azure Service Bus queue works fine, after changing my language to English.

  • v-micsh-msft Profile Picture
    on 24 Nov 2016 at 11:08:09
    Re: Problem sending message to Azure Service Bus queue

    Hi Pia,

     

    I wll try to find someone who is familiar with this to take a further look.

    There might be sometime delay before sharing the results.

    Appreciate your patience and understanding.

    Regards

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,670 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started