Variable on an interface

Hi Readers,

Needed an insight regarding the below.

I need a variable holding a single value, which can be updated through an action when a form is submitted; But it need to be visible in the form but as read only.

What i have tried: I have kept a read only grid to make it as read only, instead of a temp variable i have queried the data from a table and made only single row is visible so that the last updated value is visible.

But i do not want the value to save  in a table and query it to make it visible on the form,
instead i just need a temp variable which holds the last updated value as read only.

Elaborated:

I Am trying to create an application which has a read only variable on the form called wallet balance();

Application: There will be an interface/form which has wallet balance, current value and operation and a submit button;


We enter the wallet balance by seeing it in the read only grid, we enter the value which need to be added/deducted from wallet and an operation(+ or -) is choose and submit the form;
The wallet balance which is read only need to be updated based on the operation choose weather it can be adding to wallet balance or deducting from wallet balance.

Use case: I have said what i have tried above; but i want only the last updated row need to be visible i would like to know how can we do that;

and instead of entering the wallet balance manually it need to take the last updated row as wallet balance and calculate based on our input; and the last updated row need to be visible always as it is the current wallet balance

 

I should not get this rounded one i just need to get only the value

  Discussion posts and replies are publicly visible

  • 0
    Certified Lead Developer

    You can manage variables in an interface by creating rule inputs or local variables. Whether that is readonly or not is a completely different story and is managed by the UI component.

    I did not really understand what you want to achieve. Please elaborate.

  • A variable in Appian can only be updated using a component's 'saveInto' property. As per your use case, you use an expression rule and call that rule on the interface to populate the value. But this will not allow you to update the value inside the expression rule, programmatically! Another way is by querying the data from Db that you're already doing. 

    I am sure there must be more ways to the problem but for that, you will have to elaborate the problem more. 

  • 0
    Certified Lead Developer

    To echo Stefan - we need to know what you want to achieve at a higher level.  In other words, what's the use case?  Your understanding of some of the terminology seems a bit incomplete, but if we understand what you're actually trying to do, we're generally happy to help you sort out the rest.

  • I Am trying to create an application which has a read only variable on the form called wallet balance();

    Application: There will be an interface/form which has wallet balance, current value and operation and a submit button;


    We enter the wallet balance by seeing it in the read only grid, we enter the value which need to be added/deducted from wallet and an operation(+ or -) is choose and submit the form;
    The wallet balance which is read only need to be updated based on the operation choose weather it can be adding to wallet balance or deducting from wallet balance.

    Use case: I have said what i have tried above; but i want only the last updated row need to be visible i would like to know how can we do that;

    and instead of entering the wallet balance manually it need to take the last updated row as wallet balance and calculate based on our input; and the last updated row need to be visible always as it is the current wallet balance

  • I Am trying to create an application which has a read only variable on the form called wallet balance();

    Application: There will be an interface/form which has wallet balance, current value and operation and a submit button;


    We enter the wallet balance by seeing it in the read only grid, we enter the value which need to be added/deducted from wallet and an operation(+ or -) is choose and submit the form;
    The wallet balance which is read only need to be updated based on the operation choose weather it can be adding to wallet balance or deducting from wallet balance.

    Use case: I have said what i have tried above; but i want only the last updated row need to be visible i would like to know how can we do that;

    and instead of entering the wallet balance manually it need to take the last updated row as wallet balance and calculate based on our input; and the last updated row need to be visible always as it is the current wallet balance

  • 0
    Certified Senior Developer
    in reply to vaddhicharanc0001

    You can use local variable here . Let's say local!walletBalance is a local variable and will be used for your wallet balance field which is read only . Now whatever calculations you do ,you have to make sure you are saving updated value in the local variable. So once you do this ,every time you add or subtract any amount, this local variable should be updated based on your calculations and need to be refreshed.