简体   繁体   English

如何在 powerapps 中将详细信息表单转换为 json?

[英]How can i convert Details form into a json in powerapps?

'PowerApp->Content'.Run(JSON(DetailForm1,JSONFormat.IncludeBinaryData)

I am trying to put this action on a button but im getting an error我正在尝试将此操作放在按钮上,但出现错误

the json function cannot serialise objects of type control json function 无法序列化类型控制的对象

Is there any workaround to this?有什么解决方法吗? I want to send data to create a new excel file.我想发送数据来创建一个新的 excel 文件。

You probably don't want to serialize the form itself, but the updates that the form would send to the data source associated with it.您可能不想序列化表单本身,而是将表单发送到与其关联的数据源的更新 If that's the case, then you can use this expression:如果是这种情况,那么您可以使用以下表达式:

'PowerApp->Content'.Run(JSON(DetailForm1.Updates))

Notice that the edit form control has an Updates property, while the display form control does not.请注意,编辑表单控件具有 Updates 属性,而显示表单控件没有。 Not sure which type your 'DetailForm1' is, but if it is a display form, you can replace it with an edit form, and set its DefaultMode property to FormMode.View, and that will make it essentially a display form.不确定您的 'DetailForm1' 是哪种类型,但如果它是显示表单,您可以将其替换为编辑表单,并将其 DefaultMode 属性设置为 FormMode.View,这将使其本质上是一个显示表单。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM