cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Problem sending message to Azure Service Bus queue

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?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
wjhepworth
Kudo Collector
Kudo Collector

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.
 


View solution in original post

8 REPLIES 8
v-micsh-msft
Community Support
Community Support

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

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

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.

Hi @Anonymous,

 

Thanks for the update and sharing.

Regards

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
wjhepworth
Kudo Collector
Kudo Collector

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.
 


@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?

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.

@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

NPieper
Advocate I
Advocate I

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
})

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,463)