DMXzone Server Data Formatter Support Product Page

Value based on comparison of 2 strings

Asked 10 May 2017 14:21:22
1
has this question
10 May 2017 14:21:22 Bobby Edgar posted:
I have an upload form that then loads the image and gives me the width and height of the image and places it into the DB, no problem.

I want to compare the width and height and input a field value of portrait or landscape depending on if the width is greater than the height.

If tried several methods, but nothing seems to work.

Example:

{{portrait.where("load_image.width", "<", "load_image.height")}} OR {{landscape.where("load_image.width", ">", "load_image.height")}}



Any Ideas?

Replies

Replied 10 May 2017 14:36:47
10 May 2017 14:36:47 Teodor Kuduschiev replied:
Hello Bobby,
Just use the condition step in server connect. Use the {{load_image.width < load_image.height}} as a condition and add the insert step inside it, in the then clause, inserting "portrait". In else add another insert step, which inserts "landscape".

Reply to this topic