cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Community Support
Community Support

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

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

Highlighted
Responsive Resident
Responsive Resident

Re: Formatting issue with AzureQueues.PutMessage

Highlighted
Anonymous
Not applicable

Re: Formatting issue with AzureQueues.PutMessage

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

 

@Anonymous 

Highlighted
Frequent Visitor

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.

Highlighted
Frequent Visitor

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (4,731)