Skip to main content
Solved

Old User Property is pulled to our projects with Ampli Wrapper

  • 18 June 2024
  • 1 reply
  • 59 views

Hello,

I am experiencing an issue with the Ampli Wrapper in our Swift and Kotlin projects. We set up Amplitude Data and installed the Ampli Wrapper successfully.

We had to rename one of the User Properties from createdAt to created_at to avoid a conflict with our projects’ properties. However, when we pull the updated data on the client sides, the property still appears as createdAt despite being correctly named in the Amplitude workspace.

Screenshots are attached for reference.

 

Could you please assist us in resolving this issue?

Thank you!

1 reply

Userlevel 5
Badge +9

 

Hello @Maria Soboleva 

I hope you are having a great day!
 
It seems like you're encountering an issue where two properties are mapping to the same variable name. This can occur when the properties are named in a way that, when converted to camelCase, they become identical. For example, "media_source" and "_mediaSource" both convert to "mediaSource" in camelCase.
 
For your specific case you are doing createdAt to created_at which for iOS/Swift will resolve to camel case which would both result in createdAt
 
To resolve this, you could rename one of the properties in your Data tracking plan to ensure it's unique. However, please be cautious when using underscores (_), periods, and other non-alphabet characters, as they can sometimes lead to unexpected results.
 
Here's an example of how to properly use camelCase:

// Good
camelCase("media_source") => "mediaSource"
camelCase("media_source_2") => "mediaSource2"

Reply