cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

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
Community Support

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
Community Support

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

Responsive Resident
Responsive Resident

Anonymous
Not applicable

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

 

@Anonymous 

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

Frequent Visitor

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
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (7,680)