I have a form that I want to populate when a user clicks on a 'Copy' button. So far I have the button set up to copy the currently selected record from a gallery and store that in a global variable like this:
Set(
glbFormData,
GAL_Campaigns.Selected
);
Set(
varCopy,
true
);
EditForm(FRM_CampaignForm);
Navigate('Create Campaign')
For my form most fields I can get away with using this in the 'Default' property
Parent.Default
Or this in the 'DefaultSelectedItems' property.
[Parent.Default]
But I run into trouble with some of my other comboboxes. For example, I have a combobox that has this code in the 'DefaultSelectedItems' property.
If(
Self.DisplayMode=DisplayMode.Edit && Text(RB_Partnering.Selected.Value) = "Yes",
If(
IsBlank(newPartner),
{CB_PartnerName:Parent.Default},
newPartner
),
Blank()
)
In this case I haven't figured out a way to populate that field with the record value. Is there a way to do this?
NOTE: The last bit of code is on a combobox that is part of a two step process. If the user can not find the value they are looking for they can click an 'Add' button which hides the combobox and presents them with a text field where they can enter the missing value. Once entered they can click 'Add' and the text field and button are hidden and the original combobox comes back and is populated with the value they just entered.