01-28-2018 18:51 PM
Learn how to use a contextual variable on a custom form in order to set a column value based on the user selection (behind the scenes). This covers UpdateContext() and If() functions. We put the updated If() statement which expects three projects below so you can see what to do if there are more than two choices. Hang around till the end of the video to learn a bit about my life too!
Follow me on Twitter to suggest what you'd like covered in the next Friday Functions Video @ArtsyPowerApper
Enjoy!
OnChange of the Project Control (DataCardValue5):
If(DataCardValue5.Selected.Value="Project A",UpdateContext({VarCode:"1010"}),
If(DataCardValue5.Selected.Value="Project B",UpdateContext({VarCode:"2020"}),
UpdateContext({VarCode:"3030"})))
Default of the Code Control:
If(IsBlank(VarCode),ThisItem.Code,VarCode)
References:
https://docs.microsoft.com/en-us/powerapps/working-with-variables
watch?v=get-SziLnyU