Hi!
In a form I have, there's an Input field that isn't mandatory. My goal was for the user to fill it in but, in case they don't, for the field then to be automatically filled with info from a field of another form (one that was previously filled in and IS mandatory).
I set the NullValue of the field that isn't mandatory to get the value I want as a default and it kind of works. Basically when I create the form, the field remains empty (the issue I'm facing) but if I update the form (aka click the "Save" button again) then the field in question is, in fact, filled in with what I want.
I've also tried to do an Assign instead in the "Save" button (an IF with the condition that "NameOfTheInputField = NullTextIdentifier" then Getetc.ById.List.Current.etc). Works the same way, as in: only when I update. And I do understand the logic behind it - since the form isn't complete and submitted yet, then the IF asking if a field is null is useless in this context.
I attempted to add an Input Parameter or a Local Variable but I fear that doesn't work (or that I don't what to do with it) since I'm dealing with an atribute from another entity and also I really only want it to come into play and appear when the user wrote nothing in the field and submitted the form.
Sorry if it seems quite a ignorant question and it's easy to resolve but I've been trying for a while now with no success and already read other posts here that were similar but not quuuuiiite the same and I couldn't get there on my own.
TL;DR: Need for an input field of a form to be filled with info from another form's field ONLY IF the user doesn't fill it himself (that is, a default value).
Would this be something you are looking for?
I created two entities RandomEntity and RandomEntity2. On creating RandomEntity, it will redirect to create RandomEntity2 and pass in the value of the Name as an input parameter.
From RandomEntity 2 details page, what I've done basically, is do a check on save to populate the value of it into the form before saving if its not specified.
Thank you so much! That's exactly what I needed, the example really helped.
Hi Beatriz,
If I understood right, you can check in Preparation (Screen/Form2) what is the value filled previously (Screen/Form1) and store in a local variable or if you want to show filled with the previous value, you just need to assign in the Aggregate.
Or on the Save action you can verify if the field (Form2) is filled, notice to check and assign you need to do in the Form.Record.Entity.Attribute = LocalVariable, instead to Aggregate.list.current.
Or if you want to show the field filled before to execute the Save action, you will need an event (OnBlur, for example) to check if the user left the field empty in the server side and then perform the assign.
Regards,
Leandro.
I'm sorry for my ignorance but how do you store in the local variable the attribute that isn't the Id or that isn't the entirety of the entity the attribute belongs to? Because I'm struggling to isolate the single attribute I need to create the Local Variable I want.
Thank you so much for your time reading and answering.