Quantcast
Channel: Mockaroo Community Forum - Latest posts
Viewing all articles
Browse latest Browse all 2665

Change column data type based on value of another column possibble?

$
0
0

This if/else block below explains it better than I can with words....

if( 'project_media_type' === 'animated_gif'){
    image_url = JSON data type with image_url.gif_url, image_url.cover_img_url
}else{
    image_url = image URL data type
}

column project_media_type pulls a random value from a data set

if that value is animated_gif

then make the column image_url be a JSON data type

if the value is not animated_gif, then make the column image_url be a regular image url data type.

Is this possibble?


Viewing all articles
Browse latest Browse all 2665

Trending Articles