I am creating forms in powerapps that have multiple datacards. Datacards are visible dynamically based on the another datacard selection, based on the user role and based on the formmode (edit or view). Some datacards have auto height text box. How do I set the height of form with these conditions? I tried adding custom datacard on the bottom of form and set the form height with custom datacard's Y and height but it is not working. I am even hardcoding form heights, and resetting forms on form onSelect still it is not consistently setting the height. Please help with the solution, if any. Here is the code I have set for the form height:
If(FormSRMnewOtherSpec.Mode=FormMode.New, 210,
If(FormSRMnewOtherSpec.Mode=FormMode.View,
If(varTechWriterForm,
'Category_DataCard'.Height+'Description of Specification_DataCard'.Height+30+'Reviewers_DataCard_OtherSpec'.Height+'Review By Date_DataCard_OtherSpec'.Height+'Reminder_DataCard_OtherSpec'.Height+'Approvers_DataCard_OtherSpec'.Height+'Approve By Date_DataCard_OtherSpec'.Height+'eSignature Require_DataCard_OtherSpec'.Height,Parent.Height,
'Category_DataCard'.Height+ 'Description of Specification_DataCard'.Height+30
)),
//else is for form edit mode
If(varTechWriterForm,
'Category_DataCard'.Height+'Description of Specification_DataCard'.Height+30+'Reviewers_DataCard_OtherSpec'.Height+'Review By Date_DataCard_OtherSpec'.Height+'Reminder_DataCard_OtherSpec'.Height+'Approvers_DataCard_OtherSpec'.Height+'Approve By Date_DataCard_OtherSpec'.Height+'eSignature Require_DataCard_OtherSpec'.Height,
'Category_DataCard'.Height+ 'Description of Specification_DataCard'.Height+30))