Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

A ? B return C - Project Ading

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2021

Butler is my default go-to automation for Trello boards.

Project Ading is yet another Butler Http Request action project to complement Butler in the areas of 'conditionals' such that it will take two variables A and B and will return you variable C if the condition is met for example if A <= B set C to be "True", A != B return C="True" or if A in B return C="Hooray be", etc.

This can be easily be extended to A + B = C or A / B = C or replace A in B replace with C and return C=new B.

This implementation is made possible because recent enhancements for "conditionals" and other existing modules such a text action, list action and calculator...etc on the backend system. 

More importantly, the endpoint does not need your API key or your token for it to work.

How would you use it in Butler? You can set C to a custom field which acts as a trigger to your Butler commands. 

Feel free to comment, watch,...etc. Let me know how you might want to use it. I will update this post with more information.

2 comments

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 9, 2021

The endpoint is

https://39668.wayscript.io/ading?action=<see list of actions>&operator=<list of operators>

 

action=Compare

List of operators are "GE", "LE",...etc as in this dictionary : {"GE" : ">=", "LE" : "<=", "EQ" : "==" , "GT" : ">", "LT" : "<", "NE" : "!=", "IN" : "in"}

Payload : {"var_a" : "text, number or variable", "var_b" : "text, number or variable", "var_c" : "some text"}

Return : {httpresponse.result} for which you are expecting text in var_c

Note : Operator=IN allows you to check whether var_a is part var_b

action=Maths

List of operators are : add, subtract, multiply, divide
 

Payload : {"var_a" : "number or variable", "var_b" : "number or variable")

Return : {httpresponse.result} or {httpresponse.var_c} 

 

action=Replace

There is no operator. Note find and replace of text is case sensitive

Payload : {"var_a" :  "find this text in var_b", "var_b" : "any string", "var_c" : "text to replace all instances of var_a in var_b"}

Return : {httpresponse.result} or {httpresponse.var_c}  for which you are expecting text from var_b but replaced with var_c for all instances of var_a

Like Vitaly Andrianov likes this
Vitaly Andrianov
Contributor
February 12, 2021

@milynnus Hello,

You are doing really great job!

I just want to inform you that Smart Fields for Trello Power Up will do this task without any coding.

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 12, 2021

@Vitaly Andrianov 

Thank you for your feedback. By using Butler HTTP request action, it can be embedded with your Butler commands. As far I remembered, Smartfields values is not accessible from Butler like most Power Ups. 

Vitaly Andrianov
Contributor
February 13, 2021

@milynnus Yes it is not possible to access SmartFields values from Butler directly, but Now it's possible to trigger Butler rules from SmartFields by updating Custom field. You can use special Field like a Flag and update that Flag using conditions reached in SmartFields. Also you can mirror all necessary SmartFields to Custom Fields to use this data in Butler. 

milynnus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
February 13, 2021

@Vitaly Andrianov 

Yes, that is would be quite similar. Since A, B , C can be variable or constant it opens up a range of automation that would not be possible like testing for day of week, age of cards, days on list, etc. 

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events