我尝试使用的PowerApps - Azure服务总线连接器函数定义为:
ServiceBus.SendMessage(EntityName:Text, {systemProperties :Text, ContentData:Blob, ContentType:Text, Properties:Table, MessageId:Text, To:Text, ReplyTo:Text, ReplyToSesionId:Text, Label:Text, ScheduledEnquequeTimeUtc:DateTime, SessionId:Text, CorrelationId:Text, SequenceNumber:Number, LockToken:Text, TimeToLive:Text})正如您所看到的,ContentData属于Blob类型,而PowerApps似乎无法将文本字符串转换为blob。因此,尽管下面将发送一条消息,但在服务总线浏览器或接收应用程序中进行检查时,内容是空的。请注意,可以在接收到的消息中看到Properties表数据和标签值。
ServiceBus.SendMessage("TestTopic",{ContentData:"HelloWorld", Label:"MyLabel", Properties:Table({key:"MyUserDefinedKey",value:"MyUserDefinedKeyValue"})})有没有什么办法可以直接用文本填充ContentData?我希望使用PowerApp文本输入。
我曾尝试将ContentType和ContentData更改为各种选项,但均未成功。
发布于 2021-03-07 13:25:30
据我告诉in the docs,ContentData的数据类型是bytes,我不相信PowerApps支持它(查找支持的数据类型here)。
可以尝试的一件事是:ContentData: JSON("Hello World", JSONFormat.IncludeBinaryData)
据我所知,这是在PowerApps中处理二进制数据的唯一方法,但我不确定它是否会对文本进行编码。
发布于 2021-05-26 05:40:22
可以使用properties参数在Power Apps Service Bus连接器SendMessage调用中发送自定义属性。Properties参数接受一个表,其中包含键和值对的特定行。
我没有发现ContentData参数有很好的文档记录。在我的测试中,它接受一个带有强制base64编码的data URI字符串值。不幸的是,在canvas Power App中没有内置的base64编码方式。如果参数值的格式不正确,那么产生的Servivce Bus queue消息将有一个空的ContentData值。下面是一个向队列发送新消息的示例,它设置了代理属性: Label和三个自定义属性,以及文本"Hello world!“在ContentData参数中。
示例:
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
})https://stackoverflow.com/questions/66492254
复制相似问题