Default value in forms

But we do have default values in form entry components. Or am I misunderstanding what you are asking for?

@Darren_Murphy , @Jeff_Hager thanks for your attention.

I have not expressed myself correctly or I am missing something extremely obvious. I will explain better with an example.
Let’s say I have a custom form to insert an invoice row.
I will then have a choice component to select the item I am selling in that row; the following input fields are the quantity and the selling price.
The quantity is a variable datum and therefore must normally always be entered, while the selling price is a datum susceptible to variations.

How do I make the standard sale price appear pre-compiled in the input field?
Currently the only thing I can do is make the item’s selling price appear in the placeholder of the selling price input field.

If you tell me that I can do better you make me happy!
Thanks!

sorry for the bold text, it’s unintentional

You mean to say that the price value is dependent on the product which they choose in the choice component? Basically you want a lookup as a default value right?

1 Like

Right. I’ve the lookup on the fly and I want to put that value in the input field, just like i am doing now with placeholder but I need a default value instead.

Seems quite simple - again if using a custom form with the input components writing to User Specific Columns.

  • Create a relation between the selected product and the products list
  • Use a lookup through that relation to get the product price
  • Use a math column to calculate the total price based on the quantity selected
  • Display the result of the math column in the form, and use it when the form is submitted with an Add Row action
1 Like

I do 99% what you say, but I don’t need to calculate the price, I need to show the pre-filled typical price in the input field so that the user can confirm it or change it only when necessary.

1 Like

How about an IF column that returns the user entered price…if not empty…else return the default price.
Display that IF column price on the screen, but if the user enters a price in an entry component, then the IF will kick in and instead display what the user entered. The IF value is what will be submitted through the form.

2 Likes

Yes indeed I have done so recently, but it is not the most elegant solution, in my opinion of course.

1 Like

Haven’t tested this, but I imagine you could:

  • Use the value of the product lookup as the default for the input component
  • But have the target of the same component a User Specific column

Then use an if-then-else column to determine which value to use when Adding a row:

  • If the User Specific column is empty (user has not overwritten the default), then use the lookup value
  • Else use the User Specific column value
2 Likes

haha, snap! :rofl:

2 Likes

Yes, pretty much the same as @Jeff_Hager said.

That’s right, I am currently coming to the conclusion that it is not possible to do better than this.
Thank you all for your cooperation!

2 Likes

We share a brain.

3 Likes

…and it is one of the best things that life offers us!

1 Like

Hey Sorry @Darren_Murphy @Jeff_Hager but this is not possible right?

On a new form screen, I only have access to the previous screen columns and user profile columns
so I cannot use current form screen value to make a lookup for another component on the same form
Or is there something I am missing?
Thanks in advance for your clarification
Cheers

No it will not work. Computed columns, like a relation/lookup will only work once the data is written to the table. If you haven’t submitted the form yet, then the data is not in the table, so there will be no lookup to refer to. If you need something like this, you would be better off creating a custom form.

2 Likes

ok just wanted to be sure thanks!

1 Like

I think my original comment was in the context of using a Custom Form.

2 Likes

So only half each @Jeff_Hager and @Darren_Murphy :flushed::grimacing::rofl::rofl::rofl:

2 Likes

hey, I’ll take half of anything that Jeff has to offer any day of the week :stuck_out_tongue_closed_eyes:

2 Likes