cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
phellsten
Level: Powered On

Formatting issue with AzureQueues.PutMessage

I'm attempting to add a message to an Azure Queue, but the resulting message that appears in the queue is not formatted as expected.

 

Attempt 1:

AzureQueues.PutMessage("print-generic-label", "{""Title"":""TEST"", ""SubTitle"":""TEST2"", ""Identifier"":""TEST3"", ""PrintServer"":""TEST4"", ""PrintQueueName"": ""TEST5"", ""Size"":""1""}")

Expected:

{"Title":"TEST", "SubTitle":"TEST2", "Identifier":"TEST3", "PrintServer":"TEST4", "PrintQueueName": "TEST5", "Size":"1"}

Actual:

"{\"Title\":\"TEST\", \"SubTitle\":\"TEST2\", \"Identifier\":\"TEST3\", \"PrintServer\":\"TEST4\", \"PrintQueueName\": \"TEST5\", \"Size\":\"1\"}"

 

 

Attempt 2:

AzureQueues.PutMessage("print-generic-label", "{"&Char(34)&"Title"&Char(34)&":"&Char(34)&"Test"&Char(34)&"}")

Expected:

{"Title":"Test"}

Actual:

"{\"Title\":\"Test\"}"
  • Quotations are placed around the entire message
  • All other quotations are escaped.

 

Is there any way I can use the AzureQueues.PutMessage() function to obtain the desired message to preserve the formatting?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Formatting issue with AzureQueues.PutMessage

Hi @phellsten ,

Could you please share a bit more about your scenario?

Do you want to post a JSON string to your Azure queue?

 

If you want to post a JSON string to your Azure queue using Azure Queues connector within PowerApps app, I afraid that there is no way to achieve your needs in PowerApps currently. The """" symbol would be recognized as escaped character  \"\" in your Azure queue.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider create a custom connector based on Azure Queues Rest API to achieve your needs.

On your side, you could create a custom connector based on Azure Queues Rest API or your own designed Rest API (which used to post message to Azure Queue) within your PowerApps. Then within the custom conector, you could specify the action used to post message to your Azure Queue.

After that, you could create a connection to this custom connector within your app, then use defined action to post message to your Azure Queue.

Please check and see if the following article would help in your scenario:

https://stackoverflow.com/questions/30608730/posting-json-to-an-azure-queue-via-an-apicontroller

 

More details about creating custom connector in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
Community Support Team
Community Support Team

Re: Formatting issue with AzureQueues.PutMessage

Hi @phellsten ,

Could you please share a bit more about your scenario?

Do you want to post a JSON string to your Azure queue?

 

If you want to post a JSON string to your Azure queue using Azure Queues connector within PowerApps app, I afraid that there is no way to achieve your needs in PowerApps currently. The """" symbol would be recognized as escaped character  \"\" in your Azure queue.

If you would like this feature to be added in PowerApps, please submit an idea to PowerApps Ideas Forum:

https://powerusers.microsoft.com/t5/PowerApps-Ideas/idb-p/PowerAppsIdeas

 

As an alternative solution, you could consider create a custom connector based on Azure Queues Rest API to achieve your needs.

On your side, you could create a custom connector based on Azure Queues Rest API or your own designed Rest API (which used to post message to Azure Queue) within your PowerApps. Then within the custom conector, you could specify the action used to post message to your Azure Queue.

After that, you could create a connection to this custom connector within your app, then use defined action to post message to your Azure Queue.

Please check and see if the following article would help in your scenario:

https://stackoverflow.com/questions/30608730/posting-json-to-an-azure-queue-via-an-apicontroller

 

More details about creating custom connector in PowerApps, please check the following article:

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/register-custom-api

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

HadynM
Level 8

Re: Formatting issue with AzureQueues.PutMessage

TopShelf-MSFT
Level 10

Re: Formatting issue with AzureQueues.PutMessage

Hi @phellsten how are you progressing with this? Were the above replies helpful?

 

@TopShelf-MSFT 

phellsten
Level: Powered On

Re: Formatting issue with AzureQueues.PutMessage

Ended up using a Microsoft Flow connector to pass through a message, and in the flow put the message on the queue.

ESGary
Level: Powered On

Re: Formatting issue with AzureQueues.PutMessage

I can't believe that creating a custom connector is the accepted solution here! IIRC a custom connector means a Plan 1 license for each user, which for my organisation means ~£4000/month just so I can send about 200 messages a month to a queue, or £20/message!

 

Why is the PutMessage method messing with the format of a message? I get that some characters may need to be escaped for internal processing, but make sure they are unescaped by the time the message is added to the queue. I am supplying the method with JSON and what is being written to the queue is not valid JSON. If a connector is messing with the integrity of its input data, it is not fit for purpose.

 

Anyway, it looks like I will need to go down @phellsten's route and use Flow if that works better, adding unnecessary complexity to the whole process.

 

Please excuse the rant, but I have lost a good few hours to this!

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,639)