How do I set a Confiform Field value to the value of 2 other fields

Erin Smith October 22, 2018

I have a field in my Confiform that is set as the Primary Key in my database. The primary key is made up of the values of 2 of the fields on my form.

But when I use a Confiform rule to set the value of the Primary Key it only sets the value as the first field.

 

My Fields:

PrimaryKey - Set by rule

KeyPart1 - set by user

KeyPart2 - set by user

 

Rule:

PrimaryKey=[entry.KeyPart1][entry.KeyPart2]

1 answer

1 accepted

3 votes
Answer accepted
Tim Oldendorf
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.
October 26, 2018

This might work for you:

Change the PrimaryKey field type in the definition to be a formula field type. And then use a formula to concatenate the values together.

 

For example: in the formula enter this: 

CONCAT("[entry.KeyPart1]","[entry.KeyPart2]")

 

So then if KeyPart1 = Hello and KeyPart2 = World when the user submits the form it should give PrimaryKey a value of HelloWorld

2018-10-26_16h17_20.png

ita bellablu March 1, 2021

The example above HelloWorld has no space between two field values. How is a space added to get a space or dash between the two field values, to Hello World?

Alex Medved _ConfiForms_
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.
March 1, 2021

Just put the space where you need that... as easy as that

for example, right after the [entry.KeyPart1]

CONCAT("[entry.KeyPart1] ","[entry.KeyPart2]")

ita bellablu March 1, 2021

perfect! thanks.

Markisio June 5, 2023

what about using this in a filter within tableview for example, fy:CONCAT("FY","([entry._now.jiraDate().split(-).get(0).trimLeft(2)]+1)") 

the second part is evaluating current year, the second part works perfectly on its own but I want to add FY on the left side. Please help, thanks 

Alex Medved _ConfiForms_
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.
June 5, 2023

Try this

fy:[entry._now.jiraDate().split(-).get(0).trimLeft(2).add(1).prepend(FY)]

or... make this easier

fy:[entry._now.formatDate(yyyy).add(1).prepend(FY)]

Alex 

Like Markisio likes this
Markisio June 6, 2023

Thanks @Alex Medved _ConfiForms_  works perfectly with 

fy:[entry._now.formatDate(yy).add(1).prepend(FY)]

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events