Hi, I have some questions about doing if/then statements and setting new values based on the results, when working with text.
I query MySQL, get a bunch of data, and then post that data elsewhere.
Twitter: https://twitter.com/twitterdev Discord: https://discord.com/invite/sample Instagram: https://www.instagram.com/username Youtube: https://youtube.com/username Telegram: https://t.me/username
The data from MySQL comes as a URL (i.e. https://twitter.com/twitterdev).
I want something like:
IF twitter_url contains https, do "Twitter: Twitter: [twitter_url]" ELSE do nothing IF discord_url contains https, do "Discord: [discord_url]" ELSE do nothing
Or maybe a better way to think of it:
IF twitter_url contains https, set var twitter_publish to "Twitter: [twitter_url]" ELSE do nothing IF discord_url contains https, set var discord_publish to "Discord: [discord_url]" ELSE do nothing
So for one that only has Instagram and YouTube, the final result would be:
Instagram: https://www.instagram.com/username Youtube: https://youtube.com/username
I do not want:
Twitter: Discord: Instagram: https://www.instagram.com/username Youtube: https://youtube.com/username Telegram:
I can’t use IF nodes (if URL exists, true) followed by a SET node (set variable “twitter_line” to “Twitter: [twitter_url]”), because there are too many to re-join back with a Merge node, as it only accepts 2 inputs, and I will have a total of 10-15.
But that just returns true or false. I need it to DO something based on the result - output nothing, or output for example, “Twitter: [“twitter_link”]”
With the code editor, I don’t understand how to pull in the actual value from a previous node (i.e. [twitter_link] in, and how to make it output a new variable based on the result, like:
var twitter_publish = (twitter_link === "") ? "":"Twitter: [twitter_link]";
In Integromat/Make, what I’m trying to do is like: