2
'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

Is there any workaround to this? I want to send data to create a new excel file.

General Grievance
  • 4,555
  • 31
  • 31
  • 45
Jeet Shah
  • 23
  • 6
  • you will have to define your json, what is the attribute name (data structure) and it's value. you have nothing like this out of the box. – AnkUser Sep 09 '22 at 06:38
  • @AnkUser so the data structure is the form itself which includes data cards (with key value pairs) . I have around 8 datacards in the form – Jeet Shah Sep 09 '22 at 07:11
  • yes either create a collection with attribute name and value or create a json and add each attribute and it's value per hand. – AnkUser Sep 09 '22 at 07:35

1 Answers1

1

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. 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.

carlosfigueira
  • 85,035
  • 14
  • 131
  • 171
  • Hi @carlosfigueira !! i see your point, i do have a separate screen for edits so this only displays the details hence there is no Updates attribute – Jeet Shah Sep 10 '22 at 08:06