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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,553,214
Community Members
 
Community Events
184
Community Groups

How to use generateUUID Virtual functions in Confiform

Edited

Hi @Alex Medved _ConfiForms_ 

 

May I know how to user  generateUUID Virtual functions in Confiform, we just updating our confiform version to 3.4.3 and a bit confusing how to user this function.

 

Also of course many thanks for this a new virtual function, this function is will help us to generate the token or randomize value.

2 comments

Seems this function is not working when field type is hidden or readonly, current we are trying to using this function via iftt or rules of Rules for Field Definition

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.
May 07, 2023

Hi

What is not working for you and what have you tried?

Using this virtual function is no different to using any other virtual function ConfiForms has to offer

Little demo: http://recordit.co/ShI3YkNvoi

And the complete configuration for the reference:

<ac:structured-macro ac:macro-id="19d371ac-8613-40cc-85ca-bda73eb6b34d" ac:name="confiform" ac:schema-version="1">
<ac:parameter ac:name="formName">f</ac:parameter>
<ac:rich-text-body>
<ac:structured-macro ac:macro-id="4f216335-970b-489b-8f68-4d20e083865c" ac:name="confiform-entry-register" ac:schema-version="1">
<ac:parameter ac:name="presetValues">viaPreset=[entry._func.generateUUID]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<ac:structured-macro ac:macro-id="606b3b45-39c3-468f-8f47-eef160cbc063" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">viaPreset</ac:parameter>
<ac:parameter ac:name="fieldLabel">Via Preset</ac:parameter>
<ac:parameter ac:name="type">read_only</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="f97a9a94-a6af-4e04-ac6d-7dbbde843ce4" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">c</ac:parameter>
<ac:parameter ac:name="fieldLabel">Set UUID via rule</ac:parameter>
<ac:parameter ac:name="type">checkbox</ac:parameter>
</ac:structured-macro> <ac:structured-macro ac:macro-id="87980e82-f650-4507-9cdc-8a91f6eaccc0" ac:name="confiform-field-definition-rules" ac:schema-version="1">
<ac:parameter ac:name="condition">c:true</ac:parameter>
<ac:parameter ac:name="values">viaUIRule=[entry._func.generateUUID]</ac:parameter>
<ac:parameter ac:name="action">Set value</ac:parameter>
<ac:parameter ac:name="actionFieldName">c</ac:parameter>
</ac:structured-macro>
</p>
<p>
<ac:structured-macro ac:macro-id="3659aba6-34c3-41dc-bff9-1fdd5f4281cd" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">viaUIRule</ac:parameter>
<ac:parameter ac:name="fieldLabel">Via UI Rule</ac:parameter>
<ac:parameter ac:name="type">read_only</ac:parameter>
</ac:structured-macro> </p>
<p>
<br/>
</p>
<p>
<ac:structured-macro ac:macro-id="dbfb8a47-e490-44d8-bbec-5d5566436c64" ac:name="confiform-field-definition" ac:schema-version="1">
<ac:parameter ac:name="fieldName">roUpdatedWithIFTTT</ac:parameter>
<ac:parameter ac:name="fieldLabel">Read-only and updated via IFTTT after submit</ac:parameter>
<ac:parameter ac:name="type">read_only</ac:parameter>
</ac:structured-macro>
</p>
<p>
<br/>
</p>
<ac:structured-macro ac:macro-id="053dd0ea-fa94-43d5-abc7-64735e8af49c" ac:name="confiform-ifttt" ac:schema-version="1">
<ac:parameter ac:name="extras3">true</ac:parameter>
<ac:parameter ac:name="extras4">true</ac:parameter>
<ac:parameter ac:name="action">Create ConfiForms Entry</ac:parameter>
<ac:parameter ac:name="event">onCreated</ac:parameter>
<ac:parameter ac:name="title">entryId=[entry.id]&amp;roUpdatedWithIFTTT=[entry._func.generateUUID]</ac:parameter>
<ac:rich-text-body>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>
</ac:rich-text-body>
</ac:structured-macro>
<p>
<br/>
</p>

 Hope it helps

Alex

Like Rauzan Fikri likes this

Hi @Alex Medved _ConfiForms_ 

 

Previously the function doesn't want to work because my code is not correct when trying to set the uuid value into a field via iftt.

previous code

fieldA = [entry.fieldA.generateUUID] (the previous value of fieldA is empty)

then change the code to 

fieldA = [entry.id.generateUUID] (the field id always having value)

 

we assuming the problem is because we trying to generate the uuid value from empty field.

 

Thanks Alex for the function, this's really help

Also I just realize we can call the virtual function method via _func

 

Awesome !

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.
May 07, 2023

Yes, when you attempt to use a function on an empty field then it will obviously not work. As the expression evaluation stopes on the empty value.

You need to use the _func or some field that has a value, for example an "id" field (which has a value after submission - you cannot use it in the form view in UI for new records, as the record is still unsaved)

Alex

Like Rauzan Fikri likes this

Comment

Log in or Sign up to comment
TAGS
AUG Leaders

Atlassian Community Events