We are currently on vacation until 13th May 2024, ticket responses maybe be longer than normal during this period, sorry for any inconvenience.

Force import to start field with uppercase

Closed

Import WP Addon - JetEngine Updated 1 month ago 8 Replies

Jurgen asked 1 month ago on April 2, 2024 at 7:53 am

Hi,

Is there, maybe with a snippet, a possibility to when I import field A with the value ‘cat’, the importer changes the value to ‘Cat’ during the import process? So that every field starts with a uppercase?

In short: if a field in the CSV doesn’t start with a uppercase letter, the importer ensures that it does start with a uppercase letter when imported.

Kind regards,

Jurgen Wentzel

J

James replied Support Agent

1 month ago on April 2, 2024 at 7:58 am

Hi Jurgen,

To the right of each field there is a grey button that if clicked allows you to say if something equals this then set that so you could set it to be "cat" and return "Cat", https://www.importwp.com/docs/template-fields/#mapping-fields

James

JW

Jurgen replied

1 month ago on April 2, 2024 at 8:05 am

Wow, quick response!

And when i don't now the value of the field? So the imported field has a random value but it always has to start with a uppercase?

J

James replied Support Agent

1 month ago on April 2, 2024 at 8:06 am

What would you want to happen if the value in the csv does not match an option in the acf cbeckbox field?

JW

Jurgen replied

1 month ago on April 2, 2024 at 8:11 am

Exactly! So when i have a user who fill in "value" but the exact value is "Value" (with uppercase)  i can filter it to value with uppercase.

 

J

James replied Support Agent

1 month ago on April 2, 2024 at 8:15 am

You could instead use the php function in the field value ucfirst to force it to have the first letter uppercase

e.g. if the field had a value of {5}

you would instead use: [ucfirst("{5}")]

this would turn "red cat" into "Red cat" 

JW

Jurgen replied

1 month ago on April 2, 2024 at 8:38 am

Great! I will give it a try!

 

JW

Jurgen replied

1 month ago on April 2, 2024 at 8:51 am

It's working. Thanks a lot!

J

James replied Support Agent

1 month ago on April 2, 2024 at 10:10 am

Glad its working, I will close this ticket, If you run into anymore issues or have any questions just let me know or reply to this ticket to re open it.

To help support the plugin i would be very grateful if you could leave a rating/review only if you want to https://wordpress.org/support/plugin/jc-importer/reviews/