# Data table add different value

**URL:** <https://forums.unrealengine.com/t/data-table-add-different-value/466336>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 8, 2020, 5:44pm UTC](https://forums.unrealengine.com/t/data-table-add-different-value/466336 "2020-06-08T17:44:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mohammmadreza\_h4](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@mohammmadreza\_h4](https://forums.unrealengine.com/u/mohammmadreza_h4)\
**Post date:** [June 8, 2020, 5:44pm UTC](https://forums.unrealengine.com/t/data-table-add-different-value/466336/1 "2020-06-08T17:44:36Z")

</div>

Hi everyone  
I want to add location of my actor in data table but different values added to data table.

the Actor location is (250,-70,30)(in Pic1) but the values in data table value is different (in Pic2)  
anybody knows why this happened?

 ![303722-location.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/5/f/35fc0dc910a881704bec49b25372cf5b081bac30.jpeg)

 ![303723-datatable.jpg](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/c/d/7cdf87db8cd3eb19d9538c5b27f0415a5a58942c.jpeg)

Actor.h

```
 #pragma once
    #include "Wall.h"``
    #include "Engine/DataTable.h"
    #include "CoreMinimal.h"
    #include "GameFramework/Actor.h"
    #include "MyActor.generated.h"
    
USTRUCT(BlueprintType)
struct FActorInformation : public FTableRowBase
{
	GENERATED_BODY()
public:

	
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		FVector location;
};
UCLASS()
class UIPCG_API AMyActor : public AActor
{
	GENERATED_BODY()
	
public:	
	// Sets default values for this actor's properties
	AMyActor();
	
	UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = Animation, meta = (AllowPrivateAccess = "true"))
		class UDataTable* ActorInformationData;
protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:	
	// Called every frame
	virtual void Tick(float DeltaTime) override;

};

```

Actor.cpp

```
  #include "MyActor.h"
    #include "Wall.h"
    #include "UObject/ConstructorHelpers.h"
    #include "Engine/StaticMesh.h"
    #include "GameFramework/Actor.h"
    #include "Runtime/Engine/Classes/Engine/World.h"
    #include "Runtime/Engine/Classes/Components/StaticMeshComponent.h "
    // Sets default values
    AMyActor::AMyActor()
    {
     	// Set this actor to call Tick() every frame. You can turn this off to improve performance if you don't need it.
    	static ConstructorHelpers::FObjectFinder<UDataTable> DTBObject(TEXT("DataTable'/Game/NewDataTable.NewDataTable'"));
    	if (DTBObject.Succeeded())
    	{
    		ActorInformationData = DTBObject.Object;
    	}
    }
    
    // Called when the game starts or when spawned
    void AMyActor::BeginPlay()
    {
    	FString actorname = this->GetName();
    	Super::BeginPlay();
    	FActorInformation AF;
    	
    	AF.location = this->GetActorLocation();
    
    	PrimaryActorTick.bCanEverTick = true;
    	if(ActorInformationData!=nullptr)
    	ActorInformationData->AddRow("ActorOne", AF);	
    }
    // Called every frame
    void AMyActor::Tick(float DeltaTime)
    {
    	Super::Tick(DeltaTime);
    
    }

```
