Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to set function argument with variable ?

laurent December 2, 2020

I need two fields. One formula field to calculate a value and second field (rule or IFTTT) to run a function with the calculate value.

For example formula field result give me a number and I want use this number as argument in function trunk(var) or trim(var) or other function with argument. 

2 answers

1 vote
Katerina Kovriga _Stiltsoft_
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.
December 3, 2020

Hi @laurent ,

I guess you use ConfiForms tables and want to perform calculations in such tables.

Maybe our app will come in handy for your case - Table Filter and Charts for Confluence. The app works with the TableView macro perfectly well: you just wrap your TableView macro in our macros and perform various calculations, filter data, create pivots and charts.

To calculate some values using custom formulas, you may try the Table Transformer macro. It has two default presets (to merge and lookup tables) and a custom preset where you can paste your own SQL query to perform calculations. 

Thu 1-1.png

Here are the most common uses cases from our customers (using math formulas, comparing dates, calculating work periods, conditional formatting, etc.). Hope you'll find something that will help your case.

laurent December 13, 2020

Yes I use confiforms table but I think it's possible to calculation within confifiorms fields.

Otherwise I will test you suggestion.

0 votes
Alex Medved _ConfiForms_
Community Champion
December 4, 2020

Hi

From ConfiForms version 2.16 you can have dynamically looked up parameters in trunc*/trim* set of functions (as always you reference field value via [entry.field_name] notation).

(also supported in ConfiForms cloud)

Alex

laurent December 13, 2020

Ok its a good news.

I must have pb with syntax : 

entryId=[entry.id]&TESTFIELD=[entry.TEXTTOTRUNC.truncRight([entry.VALUEFIELD])]

I obtain RESULTFIELD="entry.TEXTTOTRUNC.truncRight([entry.VALUEFIELD])"....

Alex Medved _ConfiForms_
Community Champion
January 7, 2021

Not sure I understand you comment

Here is my quick test with your expression: http://recordit.co/K9pcI0dUdq 

laurent January 7, 2021

Ok so this is possible. Now I think that my pb comme from VALUEFIELD. In my Form VALUEFIELD is the result of a calculate. I calculate length of the text entry in TEXTTOTRUNC field with  function LEN([entry.TEXTOTRUNC]) - 2 or 3 (for e.g.) so VALUEFIELD get value of Len function and I obtain the correct number to use in the IFTTT. I think that my pb is the result in VALUEFIELD is not consider as a real number value but perhaps as a text value or something like that.  

 

I wil re-try this solution and perhaps calculating VALUEFIELD is not absolutely necessary in my application.....

TY very much for the time you paste to try help me

Wish you happy new year 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events