Setting a variable from ModelDriveFormIntegration during OnVisible
I'm building an embedded canvas app that performs several lookups when certain screens load. To avoid typing [@ModelDrivenFormIntegration].Item.EntityId every time I need to do a filter or lookup, I am attempting to set a variable Set(varEntityId, [@ModelDrivenFormIntegration].Item.EntityId) as the first line in the OnVisible method. However, the varEntityId is always empty. Therefore, the only way my LookUps work is if I always type out the entire text: [@ModelDrivenFormIntegration].Item.EntityId
Is this by design or am I missing something? Seems weird that you wouldn't be able to set a variable with the Id passed in via ModelDrivenFormIntegration.
I was into the similar situation with your's and there's a clue found by my colleague hope can help you to fix this problem by yourself,which The screen OnVisible property had been triggered before [@ModelDrivenFormIntegration] be read.
So in the case of embedded canvas app,Setting a variable during OnVisible from ModelDriveFormIntegration,value of varEntityId might be always empty if you don't load this screen again.