# I want make show the selected widget's variables in User Interface of WidgetComponent

**URL:** <https://forums.unrealengine.com/t/i-want-make-show-the-selected-widgets-variables-in-user-interface-of-widgetcomponent/1878128>\
**Category:** Programming & Scripting\
**Tags:** customization, unreal-engine, editor, slate, question\
**Created:** [May 29, 2024, 3:18am UTC](https://forums.unrealengine.com/t/i-want-make-show-the-selected-widgets-variables-in-user-interface-of-widgetcomponent/1878128 "2024-05-29T03:18:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![YJW04081](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@YJW04081](https://forums.unrealengine.com/u/YJW04081)\
**Post date:** [May 29, 2024, 3:18am UTC](https://forums.unrealengine.com/t/i-want-make-show-the-selected-widgets-variables-in-user-interface-of-widgetcomponent/1878128/1 "2024-05-29T03:18:51Z")

</div>

HI

I am working on a task where I need to add the variables from the widget selected in the WidgetClass of a widget component to the User Interface category of the widget component’s details panel, so they can be viewed there.

But

void FDetailCustomization::CustomizeDetails(IDetailLayoutBuilder& DetailBuilder)  
{  
IDetailCategoryBuilder& UserInterfaceCategory = DetailBuilder.EditCategory(“UserInterface”);

```
TSharedRef<IPropertyHandle> WidgetClassProperty = DetailBuilder.GetProperty("WidgetClass", UWidgetComponent::StaticClass());

UObject* WidgetClassObject = nullptr;
if (WidgetClassProperty->GetValue(WidgetClassObject) == FPropertyAccess::Success)
{
    UClass* WidgetClass = Cast<UClass>(WidgetClassObject);

    if (WidgetClass && WidgetClass->IsChildOf(UMyWidgetClass::StaticClass()))
    {
        for (TFieldIterator<FProperty> PropIt(WidgetClass); PropIt; ++PropIt)
        {
            FProperty* Property = *PropIt;
            if (Property)
            {
                TSharedRef<IPropertyHandle> PropertyHandle = DetailBuilder.GetProperty(Property->GetFName(), WidgetClass);
                if (PropertyHandle->IsValidHandle())
                {
                    UserInterfaceCategory.AddProperty(PropertyHandle);
                }
            }
        }
    }
}

```

}

in this code, when i builded and checked in project, not thing happened,

the Log said PropertyHandle is not valid.

what is the problem?

Thx.

---

<div class="post-metadata">

**Author:** ![Hackerharan](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/hackerharan/32/1109831_2.png) [@Hackerharan](https://forums.unrealengine.com/u/Hackerharan)\
**Post date:** [May 29, 2024, 12:23pm UTC](https://forums.unrealengine.com/t/i-want-make-show-the-selected-widgets-variables-in-user-interface-of-widgetcomponent/1878128/2 "2024-05-29T12:23:37Z")

</div>

@YJW04081 Make sure that `DetailBuilder.GetProperty` is correctly creating valid property handles for the properties you are trying to add to the details panel.
