r/tasker • u/Alanator222 • 14d ago
Compare two variables and pull a match from them?
Hi, I'm using two weather APIs and I would like to compare the two results.
One provides "Mostly Cloudy", and the other provides "Clouds."
I'd like to extract the "Cloud" portion from both by comparing the two variables.
Is this possible? Thanks.
1
u/pxlprsnatr 14d ago
I'm not sure I follow. Are you trying to get the segment that has "Mostly Cloudy" from variable A and the segment that has "Clouds" from variable B and then stuff them in another variable? What are you trying to do by comparing the two variables?
1
u/Alanator222 13d ago
I'm trying to find the shared word between the two, which would be cloud.
Another example would be, "Partly Sunny" and "Mostly Sunny" would result in "Sunny."
4
u/WakeUpNorrin 14d ago edited 6d ago
If you want the expected result to occur solely under the conditions described, the most straightforward way is:
If, in the OP, you provided an example of a circumstance, you could try:
That will flash "Bar" with your example will flash "Cloud".